Uploaded by muzammil hussain

Aws Solution Arc

advertisement
Configure and Connect a MySQL Database Instance with a Web Server
Step 1: Create a MySQL RDS database in AWS with the following configurations
Create a Database Instance with the following specifications:



Database creation method: Standard Create
Engine: MySQL
Database Instance size: db.t2.micro
A New MySQL Database is created.
Step 2: Create an EC2 Instance with the following specifications:
o
o
o
o
AMI: Amazon Linux
Region: Use only US East (N Virginia), us-east-1, and us-east-2
Instance types: t2.micro and t3.micro
Allowed EBS types: GP2 and Standard
A New Security Group is added for MySQL access.
A new Key Pair is Created and the instance is launched
Step 3: Now we need to install MySQL client in our linux kernel System. So we
access it via SSH using putty gen and putty.
Login as: ec2-user
For root user, use command sudo su.
Now install MySQL client using command yum install mysql.
Now to connect MySQL database to EC2 web server, copy the endpoint from
MySQL database created.
Before that, change the inbound rules in security group to anywhere, so we
can access MySQL.
Now to connect MySQL with web server we need this command line.
mysql -h mysqldb21.cqcbezwdhn7d.us-east-1.rds.amazonaws.com -P 3306
mysqldb21 -p.
We are connected to MySQL database now.
Now we need to create an Autoscaling Group to ensure that the server scales
automatically and the traffic is optimally routed among the scaled servers.
So first we create an Image of current ec2 instance.
A new custom AMI is created. A new custom AMI is created. And then in same
ec2 dashboard, we have launch configurations
A new Launch Configuration is created using AMI created and existing keypair.
Now we need to create a Load Balancer.
A Classic Load balancer is choosed.
Ping Path is set to root.
A New Load balancer is created.
Now we should create an AutoScaling Group.
Attach the load balancer which we created. And set the capacities
As you can see three desired instances are created.
Download