Tuesday 11/9/21 AWS/Cloud Study Update: Relational Database Service, CSA CCSK Exam

Adrian Cantrill’s SAA-C02 study course, learn.cantrill.io, 45 minutes:'[DEMO] Migrating MariaDB database into RDS: parts 1 and 2′

CSA CCSK Exam, 15 minutes: Reviewing domain 2

‘[DEMO] Migrating MariaDB database into RDS part 1’: The purpose of the demo was to implement the prior theory by provisioning an RDS instance and migrating the MariaDB database from the EC2 instance over to RDS. We began with a single database instance, added in multi-AZ capability, and worked with backups and restores for the experience.

The first two steps were to provision the RDS instance and then to migrate data onto it. We utilized a one-click deployment, which created a CFN stack.

After the infrastructure was completed, we navigated to EC2, which contained the same two instances we’ve been using right along, the main WordPress EC2 instance, and the MariaDB database instance.

First we created the wordpress site and a blog post, so that we would generate some data to populate the database with.

After this we migrated to RDS. To begin creating the RDS instance, we created a subnet group, a VPC for the subnet groups to live in, and then AZ’s and subnets we would use from our existing infrastructure.

After this we navigated to the VPC service and looked at the ip range for our three db subnets. Then we used this information to pick the subnets we would use. Then we created the subnet group, which we used to provision our RDS instance, which is what RDS uses to place database instances into. There are a myriad of RDS possibilities, so it is very important that RDS has this subnet information available.

After this we provisioned the RDS instance in the RDS service, for which we used standard create. This gave us practice building the RDS instance from the ground up. For this, we used MySQL. We looked at various kinds of templates, and picked the free tier template and used MySQL 5.7.31.

The next step was to add the RDS identifier, a name and the password we have been using for these lessons. After this we specified the class. Classes are very similar to EC2 instance types. This was followed by the storage type and size. Because we have been using the free tier template, we were not able to set durability and availability parameters, as the free tier template is only available in one AZ. Then we chose the specific VPC we wanted to use along with the subnet group. We chose to not make the RDS instance publicly accessible. To increase security, we created a new security group, and let RDS choose which AZ our instance would be located in.

For authentication preferences, the options were password authentication only, or password and IAM database authentication. Because of the SAA focus of these lessons, we chose password authentication only. Next we scrolled down and expanded the additional configuration section, and in this section we configured an initial database setup for migrating data to from our EC2 instance.

Continuing on, we ignored DB parameter and options groups, because they are not germaine to the SAA certification level, and spent some time looking into backups, retention periods and backup windows. We did not look at logging into advanced monitoring, log exports, maintenance windows or deletion protection. This was all followed by creating the RDS instance.

‘[DEMO] Migrating MariaDB database into RDS’ part 2:

Now we commenced with looking at the RDS instance in some detail, including the Endpoint name and port, and the Region, VPC, and subnet group used in the provisioning of the RDS instance. After this we configured the security, which prompted us to enable communication with RDS.

We looked at the monitoring tab, logs, events, along with the configuration and backup and maintenance tabs. Moving to the connectivity and security tab, we enabled the process of migrating data to RDS. We proceeded to connect to the non-database EC2 instance in a new tab using instance connect. Running everything from bash, we created a backup of the MariaDB database, running ls -la to see a long list of all files and directories currently running on our EC2 instance.

We then imported the backup file into the destination database, which involved copying the endpoint cname and pasting that into the destination part of the command we were using, and then we modified the WordPress configuration file to point to RDS. For this we opened the config file using nano. The last step was to systematically clean up our infrastructure.

CSA CCSK exam: I only spent about 15 minutes going over what I worked on yesterday, as I am very tired and need to get a solid night’s rest.

Published by pauldparadis

Working towards cloud networking security as a profession.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: