Skip to content

learnwithabhishek/Lift-shift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

Lift-shift

About the project:

• Multi-tier web application stack (VPROFILE)

• Host & run-on AWS cloud for production

• Lift & shift strategy

SCENARIO:

Application services running on physical/virtual machines

Work load is in your datacentre.

PROBLEM:

• Complex management.

• Scale up/down complexity.

• Upfront capital expenditure & regular operations expenditure

• Manual process

• Difficult to automate

• Time consuming

Solution:

Cloud computing setup

AWS Services

• EC2 instances: VM for TOMCAT, RabbitMQ, Memcached, MySQL

• ELB (Load Balancer)

• Autoscaling: Automating VM scaling

• S3/EFS Storage: Shared storage

• ROUTE 53: For private DNS Service

• IAM, ACM, EBS also used

image

Steps

Create key pair of instances

Create security groups – ALB_SG(Allow https from all ipv4 and ipv6) , vrofile_app_SG (allow 8080 from ALB_SG), Backend_SG(Allow all traffic from vprofile_app_SG , allow all traffic from own sg) image image image

Create db01, mc01, rmq01 instance with centos7 ami and configure it with "vprofile-project/userdata/ mysql, memchache, rabbitmq files". All of these instances will have backend_SG attached.

Create private hosted zone, vprofile.in, in Route53. Create A records: db01.vprofile.in to private ip of db01, mc01.vprofile.in to private ip of mc01, rmq01.vprofile.in to private ip of rmq01 : image

Update vprofile-project/src/main/resources/application.properties file : image

Create vprofile-app instance using ubuntu 20.04, install tomcat9, from vprofile-project/userdata/tomcat_ubuntu file

Run MVN clean install in the directory where pom file located to get the artifact

image

Upload the artifact(vprofile-project/target/vprofile-v2.war) to s3 bucket image

Create a role with s3 full access and attach the role to vprofile-app instance. Install awscli. image

In vprofile-app instance remove ROOT from /var/lib/tomcat9/webapps/

Stop tomcat9: (sudo systemctl stop tomcat9)

Copy the artifact vprofile-v2.war from s3 bucket to vprofile-app instance at /var/lib/tomcat9/webapps/ROOT.war location

Now start tomcat9: (sudo systemctl start tomcat9)

image

Create AMI image from vprofile-app instance

Then create a launch template using the above AMI

Create a target group which do health check on port 8080, include vprofile-app instance into it

Then create application load balancer using above target group. Add listeners at port 443(https) image

Add SSL/TLS certificate for https traffic

image

After load balancer created, go to dns registrar, (ex. Godaddy) create a CNAME DNS record with name vprofile and value will be load balancer dns name. image

After all health checks completion you can access your vprofile application at "vprofile.yourdomain"

image

login with username: admin_vp and password: admin_vp image

Click on Rabbitmq, if backend rmq01 instance running and configured properly then will receive msg: image

Click allusers then click on any user, if you get response then db01 instance working and connected properly: image

Click back button, and select same user. Now you get cached data from memcache: image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published