简体   繁体   中英

Auto scaling on amazon ec2

I have deployed my application on amazon ec2. I have installed tomcat and mysql on ec2 instance. What will happen if auto scale creates new instance? will it copy tomcat and mysql on new instance? Appreciate the answer provided.

Thanks Inderjeet

No it won't automatically copy any of that. You need to move your database outside the autoscaling group, probably into RDS. And you need to configure startup scripts that will install your application on a new instance, or create a custom AMI for the autoscaling group to use.

You can install and setup tomcat in ec2.and then create an ami. Then attach that ami to auto scalling configuration. Also you need to write a statup script that will get updated code on tomcat. And use rds for mysql.

Auto Scaling requires you to define a Launch Configuration .

The Launch Configuration tells Auto Scaling how to launch new instances . It includes:

  • AMI
  • User Data script (that is run after it boots)
  • Instance Type
  • Network settings

Therefore, if you want software to be installed on an instance that is created by Auto Scaling, you can do it via two methods:

  • Create an AMI with all software pre-loaded, or
  • Provide a User Data script that will install the software
  • ...or a bit of both!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM