0

I have one ec2 instance and it is connected to a load balancer. My scenario is this:

1) This ec2 instance works alone

2) When an over-load happens on the server, add a duplicate of it to it's load balancer. (max 3)

3) When the over-load ends, delete that extra one.

To provide this scenario, I am trying to create an auto scaling group and set it to my load balancer with demanded & minimum & max amount as 1 and mark the "Keep this group at its initial size". But when I set the auto scaling group, it automatically creates an empty ec2 instance and sets it to my load balancer (not a duplicate of my ec2 instance, just a brand new one which is "out of service" all the time for the load balancer). When I check the instances of the newly created auto scaling group just see the newly created one, not my instance.

My question is "How can I set the auto scaling group so that checks my ec2 instance located in my load balancer, duplicates one when needed, appends to my load balancer and removes that added one when need ends?".

Bahadir Tasdemir
  • 10,325
  • 4
  • 49
  • 61
  • In ASG the new instance gets created from the AMI you have set while carting the group and not from the already running instance. Are you sure you are using AMI taken from the EC2 instance that has the running application? – Piyush Patil Sep 07 '16 at 15:53
  • Yes I am choosing the same AMI. So if it is created from the AMI, not a duplicate of the running ec2, then how the new created instance can help the current one? Must I configure something else? – Bahadir Tasdemir Sep 07 '16 at 16:53
  • Yes you will have to configure either user data scripts which syncs the data from the running instance to newly created instance or a automate process where the files are in sync on both he instances. – Piyush Patil Sep 07 '16 at 16:57
  • Vaow I will investigate that, thank you very much. – Bahadir Tasdemir Sep 07 '16 at 19:55

0 Answers0