Thursday, October 22, 2020

Upgrading Mariadb from 10.1 to 10.3 on Centos

To upgrade Maraidb from 10.1 to 10.3 use the steps mentioned on Mariadb Website, i followed the same and was able to successfully upgrade the database without facing any issues.

I will share below, it is always recommended to go through the official documentation is detail to understand what new features are available post upgrade and what will become obsolete.

As a first step ensure to have a full DB backup before starting any activity.

1. Modify the yum repository configuration to point at install 10.3 Version:

# MariaDB 10.3 CentOS repository list

# http://downloads.mariadb.org/mariadb/repositories/

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.3/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1


2. Next step is to stop running mariadb Database:

 Systemctl stop Mariadb


3. Uninstall the old/existing version from the server:

yum remove mariadb mariadb-server

This should remove existing installed software, it will not remove any of the existing Data related files

4. Once above is done install the new Version of Mariadb 10.3 using yum:

yum install mariadb mariadb-server


5. After successful installation edit my.cnf/server.cnf to make any changes as per the setup

6. Start Mariadb, it should start and monitor logs for any errors

 systemctl start mariadb

7. The last step is to run mysql_upgrade command from unix prompt, this will ask for root password or a user having equivalent privileges can also be used

mysql_upgrade does two things:

  1. Ensures that the system tables in the mysql database are fully compatible with the new version.
  2. Does a very quick check of all tables and marks them as compatible with the new version of MariaDB .

At the end the output will be OK, and we are all done


Thursday, June 4, 2020

Creating MYSQL Database on AWS RDS

Today i created an MYSQL database on AWS RDS, have been thinking of doing this from quite some time and  got sometime to work on this one. RDS is  managed service from amazon , means you can create a database from AWS console , but the underlying servers/OS is managed by Amazon.

Let's check the  the process followed for the same:

Login to AWS console and click on databases:


Click on Create Database and you will see many database, i chose MYSQL for my purpose





Next step is to select template, to chose if this database is for production,dev/test or free tier. based on your selection different features and pricing will be enabled accordingly


Next choose CPU, memory ,storage required 



Next is to select availability and scaling if requires, since i have chosen free tier this option is disabled for me.


Next step it to choose authentication method,i chose password


while  clicking on additional configuration from above, Next steps are to set database name ,parameter group,option group , backups, retention, monitoring, logs enabling..





Once all done click create and you will see DB getting created.


This will take a few minutes and once done we can connect to RDS using endpoint given on the console:


mysql -h mysql.endpoint.rds.amazonaws.com -P 3306 -u mymasteruser -p

After that you will see a prompt like :

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 320 Server version: 5.7.22-log MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>


And we are Done, Happy Learning as Always


Saturday, May 30, 2020

Creating SQL Server on Azure Cloud

Today i created an SQL Server Database on Azure cloud, Now a days many organisations are increasingly moving to cloud on various databases. I thought of trying SQL Server today and am still exploring all the options provided in azure for SQL server.

I captured some screenshots for the same and can outline the process:

In azure portal go to Databases and click on SQL Servers, the click create.
  
     The below screen will appear, Provide the resource group, Database Name and Server name. To create a server click on Create new and a new screen will appear 


In this screen provide server-name,username,password,location 

            

 You will need to check storage/compute option, do click and check how many DTU's and Disk space is required since you will be charged for the same. I chose a basic one for my testing 



Once done next page will be to validate network connectivity, i clicked on public endpoint to allow my machine to access the database (this, myip needs to be configured in firewall setting as well) 



Next step is Data source - if you want to create a blank, sample database or import from an existing one. i chose to create sample DB.



At the end click review and create and the deployment will take place, this takes a few minutes.


Once Done we can connect to your database using query editor and giving username/password that was given during DB Creation.




Sunday, May 24, 2020

Mounting azure file share on your linux/unix machine

So once you create file share in azure, and need to access from linux server how to do that?

In azure portal , click on the file share and you will get an option named - Connect

Go to linux VM , you will see a script that needs to be run on azure linux vm to mount the fileshare.  

In my case i ran the script on my azure vm and file share got mounted without any issues.



Filesystem syntax will be in the form of :

//yourstorageaccount.file.core.windows.net/filesharename




Saturday, May 16, 2020

Azure Storage - Containers,blobs,file shares

Microsoft Azure Cloud can store data in a storage account, once a storage account is created we get different options to store data:

1. Containers for blob storage - Blob storage is designed for storing unstructured data , designed mainly for images, or documents directly from browser , video, audio,storing data for backups and recovery etc..

To create blobs, click on container and you will can add new container to hold blob data along with access level




Friday, May 15, 2020

aws s3 command to list and copy files from and to AWS s3 Bucket

AWS S3 command is used to copy data from AWS bucket to a location - say a mountpoint on unix 

box or vice-versa or buckets

This command is similar to Unix cp command. I used aws s3 ls and aws s3 cp to copy files from S3 bucket sometime back.

buckets to a mount point in the server. 

Below are some examples and syntax for the same:

1. List directories and files :

 aws s3 ls s3://path/file 

ls command with list objects and common prefixes under a specified bucket and prefix.

2. List content in a directory:

aws s3 ls s3://path/directory --recursive 

with above command all contents in directory are listed.

3. Copy files from S3 bucket to a mount point :

aws s3 cp://file path /tmp

in above command aws s3 copy command copies a file from S3 bucket to a local mountpoint /tmp

4. Copy files from mount point to s3 bucket:

aws s3 cp /tmp/file1.txt s3://path/fil1,txt

5. Delete files in bucket :

aws s3 rm s3://path/file1.txt


6. Display file with file size in human readable format:

aws s3 ls  s3://path --recursive --human-readable --summarize