Lift and Shift Application Workload project run on AWS cloud
EC2 Instances
ELB (Load Balancing)
Autoscaling
S3/EFS Storage
Route53
IAM, ACM, EBS ...
Steps:
Login to AWS
Create KeyPairs
CReate Security groups
Launch instances with userdata (Bash Script)
Update IP to name mapping in Route53
Build Application from source
Upload to S3 bucket
Download Artifact to Tomcat Ec2 instance
Setup ELB with HTTPS (Cert from Amazon Certificate Manager)
Map ELB endpoint to website name in Godaddy DNS
Verify
Build Autoscaling group for Tomcat instances.
---------------------------------------------------------------------------------------
---------------------
Mysql - 172.31.25.209 35.87.143.186
Memcache - 172.31.23.22 18.236.176.223
RabbitMq - 172.31.24.37 52.40.57.226
Tomcat - 172.31.29.45 34.217.25.79
172.31.25.209 db01.vprofile.in
172.31.23.22 mc01.vprofile.in
172.31.24.37 rmq01.vprofile.in
172.31.29.45 app.vprofile.in
---------------------
1. GitHUB : https://github.com/devopshydclub/vprofile-project
ACM: Amazon Certificate Manager
2. Create Security Groups
vprofile-ELB-SG: Inbound: 80, 443
vprofile-app-sg: Inbound: 8080
vprofile-backend-sg: Inbound: 3306, 11211, 5672, All traffic Self group
3. Created Key Pair
4. Create EC2 with userdata
MySQL - CentOS7
Memcached - CentOS7
RabbitMQ - CentOS7
5. ROute53 - Create a private hosted domain
Add subdomains with each VPS private IPS
db01.vprofile.in - 172.31.25.209
mc01.vprofile.in - 172.31.23.22
rb01.vprofile.in - 172.31.24.37
6. Setup JDk3, Maven and Awscli using clocolatey in local machine
7. Clone the artifact
git clone https://github.com/devopshydclub/vprofile-project
get checkout aws-LiftAndShift
cd vprofile-project
mvn install //it will build the code and give a .war file result
8. Create s3 Bucket
aws configure // to configure and link AWS account
aws s3 mb s3://vprofile-artifact-storage
aws s3 cp vprofile-v2.war s3://sherinsstorage/vprofile-v2.war
9. Create a IAM role to download file from S3 to App server
IAM> Roles > Create a new role >
10. Access tomcat server and stop tomcat, also install aws cli on it
aws s3 cp s3://sherinsstorage/vprofile-v2.war /tmp/vprofile-v2.war
cd /var/lib/tomcat8/webapps/
rm -rf ROOT //Removing the default
mv /tmp/vprofile-v2.war /var/lib/tomcat8/webapps/ROOT.war
systemctl start tomcat
11. Make sure that the Backend services like MySQL is getting connect from App server
If it is not responding on telnet request, makesure that the private DNS is created on the same region
12 . Its time to create a Load Balancer:
12.1 Create Target Group
Instances > Protocol HTTPs:8080
Health check path: /login
12.2 Cretae Load Balancer > Application Load balancer > Create >
13. Setup a DNS CNAME for vprofile.sherinsha.in > Load balancer DNS name
14. Verify http://vprofile.sherinsha.in
U: admin_vp P: admin_vp
Auto Scaling
-------------
Setting up AS for Application server
1. EC2 > Create AMI for the app server
2. Launch Configuration for ASG > Create >
3. Create Auto SCaling Group