Start a Project

Creating Amazon Aurora DB cluster : More Practical Approach To Aurora

In our previous blog, we talked about why we need to migrate our database to AWS cloud and how Amazon Aurora fits in our environment where we need to handle multiple magento sites. If you haven’t read the blog yet, please follow the link :- http://cloudkul.com/blog/amazon-aurora-scaling-magento-sites-aws/

Today, Let’s focus on some practical aspects of Amazon Aurora including how to create an Amazon Aurora cluster and how you can access your database. Here we go !!

Creating an Amazon Aurora DB Cluster :-

Before we go ahead, there are some important points we should focus on :

An Amazon Aurora database cluster is the combination of instances that are mysql compatible and a cluster volume which represents that the data are copied across three availability zones  as a single,virtual volume.Hence, there are two types of instances :-

An Amazon Aurora DB cluster can only be created in an Amazon Virtual Private Cloud (VPC) with at least two subnets in at least two Availability Zones. Since your cluster instances are now distributed across two availability zones, you can ensure that instances in your database cluster is unlikely to have availability zone failure. There are two ways provided for this :-

To launch an Aurora DB cluster using the console, follow the steps :-

  1. Open the Amazon RDS for Aurora console.In the left navigation pane, click DB instances.
  2. Click Launch DB Instance, the wizard opens on the select engine page.
  3. Select Amazon Aurora as your database engine.
  4. Specify DB details as mentioned. You can modify DB instance class and the other settings accordingly.
  5. On the next step, you need to configure some advanced settings. You can either use existing VPC, if any, or choose create a new VPC option directly provided on RDS console.Since i have chosen the latter one, a VPC along with a subnet group will be created automatically before creation of DB instance proceeds. You can modify database details accordingly.
  6. Proceed to the next step & view your DB instance after it is being created.
  7. You can see that one aurora instance with writer role and another with a reader role is created. As i have mentioned earlier that we can attach upto 15 aurora replicas to the primary instance, you can create some more replicas in order to support read workloads.
  8. To create an Aurora Replica, click Instances on RDS console.Click Instance Actions, and then click Create Aurora Replica.You must see something like this :
  9. Specify the details and click on Create Aurora Replica.
  10. Now you can see that your DB instance with writer role has two read replicas.

After successfully creating Aurora instances, you need to know how to connect to your DB instances.

To connect an Aurora DB cluster using the console, follow the steps :-

The basic approach to access the database of Aurora cluster is to run the following command :

NOTE : While copying endpoints of DB instance, make sure that you don’t copy the port appended to it. 

Therefore, in our scenario we need to run the following command :

where “webkultest.cluster-cqgmgnd8vfpz.us-west-2.rds.amazonaws.com” is our cluster endpoint and “webkul” is our master DB user. After hitting this command,we need to enter password assigned at the time of DB cluster creation.

This was all about creating Amazon Aurora DB cluster and accessing database. To know more about migrating data to an Amazon Aurora DB cluster, please refer our next blog !!

IN CASE OF ANY QUERIES, PLEASE CONTACT US

 

Exit mobile version