- Log on to AWS account using the IAM credentials,and from the AWS Management Console, select the Relational Database Service option under Database
2. Select the Engine
3. As we discussed earlier,we have six relational db engines are available with amazon RDS,Now am going to launch MySQL.
- If you want to use FreeTier eligibility make sure you selec tthe tick mark for the below option and click on Next
4. If you don’t want to get charged or want to use free tier eligibility make sure you select this option“Only enable options eligible for RDS Free Usage Tier”
5. I want to use free trier for the DB instance,so selecting My SQL community edition,in next we have to specify the DB Details
DB Engine:We have selected the Db Engine as MySQL.
License Model:MySQL databases have only one license model;that is,general public- license. AWS provides the required license keys for your databases,so you don’t have to separately purchase one.
DB Engine Version :RDS provides and supports a variety of database engine versions that you can choose from.
DB Instance Class:We have multiple DB Instance Classes with various configurations(vCPU &RAM),Select the appropriate one as per requirement.
Multi-AZ Deployment:Select“Yes/No”for Multi-AZ based on requirement.
Storage Type: Select the Storage Type between“General purpose SSD”and“Provisioned IOPS”.
Allocated Storage :We can select from 20 GB to 6 TB.
DB Instance Identifier:Give a valid name for the DB instance and this must be unique in the selected region.
Master Username: Give a valid username to login to the Db instance.
Master Password :Give a valid password for the master username.
6. In Step 3,we need to Configure Advanced Settings
VPC: Here am selecting Default VPC to host this instance.
Subnet Group:Selecting the default Subnet Group.
Availability Zone:We can select the desired AZ based on the region.
Public Accessible:Select“Yes”if you want EC2 instances and devices outside of the VPC hosting the DB instance to connect to the DB instance. If you select No,Amazon RDS will not get a public IP address to the DB instance,so we can not connect over internet.
VPC Security Groups:It works same as the EC2 instance security group,As we are launch MySQL port number 3306 must be opened .For Ms SQL port number is 1433.
Database Name:Provide a suitable database name here. RDS will not create and initialize any database unless you specify a name here
Database Port:Provide the port number using which you wish to access the database. MySQL’s default port number is 3306.We can not change the default port number after db instance launch.
DB parameter Group: DB parameter groups are logical groupings of database engine configurations that you can apply to one or more DB instances at the same time. Go with the default option here.
Copy Tags To Snapshots:Give a tick on checkbox if you want to copy the tags to created snapshots of the db instance
Option Group:This option is similar to DB parameter groups in that they too provide and support few additional configuration parameters that make it easy to manage databases.
Enable IAM DB Authentication:We can use IAM users to use the db,but the IAM user need to have appropriate permissions. Select “Yes”to manage your database user credentials
Enable Encryption :RDS provides standard AES-256 encryption algorithms for encrypting data at rest. T2.micro will not support the encryption
- We can set the Backup Retention Period as well as the Backup window’s Start Time and As discussed above if we enable amazon creates automated backups.
Enable Enhanced Monitoring:We can use Cloud watch to monitor the db instances,give yes if you want to change the default monitoring period to detailed monitoring
Log Exports: We can get the required logs for the Cloud watch service.
Auto Minor Version up grade: Specify Yes to enable automatic upgrades to new minor versions as they are released.The automatic upgrades occur during the maintenance window for the DB instance.
Maintenance Window:We can select the period in which you want pending modifications Any such maintenance should be started and completed with in the selected period.If you do not select a period,Amazon RDS will as sign a period randomly.
7. After configuring all the above steps,choose Launch DB instance option.DB instance creation will be initiate now.
We have four steps for instance launch stage: Creating, Modifying, Backing-Up and Available.
This is the first stage of any DB instance’s life cycle where the instance is actually created by RDS.During this time,your database will remain in accessible.
This state occurs when ever the DB instance enters any modifications either set by you or by RDS itself.
RDS will automatically take a backup of your DB instance when it is first created.You can view all your DB instance snapshots using the Snapshots option on the navigation pane.
This status indicates that your DB instance is available and ready for use.You can now access your database remotely by copying the database’s end point.
Here is the details for newly launched RDS instance.
8. To test the connectivity we are going to use MySQL Workbench application,Download and install on any of the local machine or EC2 instance if you want to test it in graphical manner. You can download the MySQL workbench from the following URL: https://dev.mysql.com/downloads/workbench/
9. I’ve copied the End point URL of my DB instance and opened the installed MySQL workbench application and add a connection and give a name for the connection,Enter the Endpoint name in Host name field,port number is 3306,Enter username and click onTest Connection and Give the password,you should get a Successful rest result.
10. We can verify the Server Status by navigating to Server and selecting the Server Status option.
11. By using the work bench,we can create databases,schemas and we can manage the database graphically.
To test the MySql fromLinux machine,Launch a Linux instance and install the mysql package by running yum install mysql option.
After launching the Linux instance, Install mysql package by running.
yum install mysql
Then run #mysql-u<USERNAME>-h<DATABSE_ENDPOINT>-p and press enter,It’ll ask you to enter the password of connecting user,then you can access the mysql database.
DB Instance Actions:We can find the below options when you select the db instance and choose Instance Actions option.
Create Read Replica:As we discussed above,we can create read replicas of the primary db instance for scaling purpose,We’ll get a new endpoint for read replicas and the launch wizardis almost same new db instance launch.
Create Aurora Read Replica:If we need a replica with aurora db engine,we can choose this option and follow wizard.Read replica will create with aurora db engine.
Promote Read Replica:If you want to promote read replica to a stand alone db instance,we can select this option,But the replication between primary db and read replica will breakdown.
Take Snapshot: For backups of the db instance we can use the snapshots.
Restore to Point in Time:With this option we can create a new DB Instance from a source DB Instance at a specified time.This new DB Instance will have the default DB Security Group and DB Parameter Groups.
Migrate Latest Snapshot:We can migrate the selected database to a new DB Engine by selecting desired options for the migrated instance.For mysql“Aurora”and“maria db”.
Modify:By using modify option,we can change the db instance properties i.e;DB engine version, instance class,storage options,master password,backup retention period and maintenance periods.
Stop: Instance will changes it status to Stopped state, we can start at anytime.
Reboot: underlying instances operating system will reboot.
Delete:Db instance will delete.When you perform delete option AWS will ask you to create a final snapshot.If the data in the db is important,we can take a final snapshot to launch it in future, otherwise we can select No and delete the db instance.
More Information :https://www.fgrade.com/aws/