Wednesday, May 4, 2016

Create a Database server on AWS

We can use Amazon Relational Database server (RDS) to run the database. When we launch a Multi-AZ DB instance, Amazon RDS automatically provisions and maintains a synchronous standby replica in different availability zone. Updates to the DB instance are synchronously replicated across availability zones to standby inorder to keep them in sync and protect the database update against DB failure. 

First step is to create security group for DB instance

1) Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
2) In the navigation pane, click Security Groups, and then click Create Security Group.
3) Enter DBServerSG as the name of the security group, and provide a description.
Select your VPC from the list.
4) On the Inbound tab, click Add Rule. Select MYSQL/Aurora from the Type list. Under Source, select Custom IP, start typing WebServerSG in the text box, and then select the WebServerSG security group.
Create a security group for your database server.
Click Create.

Next step is to Launch DB instance
1) Open the Amazon RDS console at https://console.aws.amazon.com/rds/.
2) In the navigation bar, verify that US West (Oregon) is the selected region.
3) In the navigation pane, click Subnet Groups, and then click Create DB Subnet Group.
4) Complete the Create DB Subnet Group page as follows:
5) Enter a name in Name. For example, my-db-subnet-group.
6) Enter a description in Description.

Select your VPC from VPC ID.

In Availability Zone, select the first Availability Zone from the list. Select the private subnet from Subnet ID, and then click Add.
In Availability Zone, select the second Availability Zone from the list. Select the private subnet from Subnet ID, and then click Add.
Click Create.

In the navigation pane, click Instances, and then click Launch DB Instance.
On the Select Engine page, select the MySQL tab, and then click Select.
On the Do you plan to use this database for production purposes page, under Production, select MySQL, and then click Next Step.
On the Specify DB Details page, do the following:
Keep the default license model and the default DB engine version.
Select db.t2.micro from DB Instance Class.
In Multi-AZ Deployment, select Yes. Although the Multi-AZ deployment is more expensive, it is a best practice.
Select General Purpose (SSD) from Storage Type and keep the default value for Allocated Storage.
In DB Instance Identifier, enter my-db-instance.
In Master Username, enter db_user.
Enter a password in Master Password and Confirm Password. Record your password in a safe place.
Click Next Step.

references:

No comments:

Post a Comment