Actually I am still a bit confused with aws auto scale up
and load balancer
I am wondering if someone can help me clarify if my logic of understand is right and if so, would it be possible to combine the usage of auto-scale up
and load balancer
?
As for auto-scale up
let's say I can setup a cloudalarm
that if my main instance
reaches to cpu > 90%
for a minute
then a new instance
will spin up and the new instance
will share the burden with the main instance
to lower the cpu usage. (after spin up, aws will do the rest for us)this is as if I set the setting to spin up 1 instance up to 5 max
If this is correct for my understanding, does the new instance
need to have the exactly the same settings of the server? If so, that means I need to create an image of the main instance
and each time if I update the main instance
I will have to create a new image
then change the cloudalarm
/ auto-scale up
to launch the new image
right?
- If the above is right, is there a better way of doing this?
or else, it seems like I have to keep on creating image and change settings if the
main instance
get changes everyday.
As for load balancer
, I read through the documentation and played around. Spin up three instances
, registered them all to load balancer
. All 3 are healthy, and if I reload the page, it keeps on changing between the three instances
. If one instance is down, the other two will be running.
If this is also correct for my understanding, does this mean I need to have 2+ the same instances running and each time when I do deployment I need to do it to all the instances? Wouldn't this be a lot of work if I have lots of servers and want all of them to use load balancer
in case the server suddenly becomes unhealthy?
If both of my understanding are correct, is it possible to somehow use auto-scale up
with cloudalarm
that if somehow main instance
is unhealthy create image of the instance then register to the load-balancer
?
Sorry for the trouble for the readings, but I do wondering if I am understanding them wrong or I am over thinking and getting myself confused.
Thanks for any advice and help.