Monster Market is moving to a fleet. The install script is ~/app.sh (each server needs about a minute to start and then answers /health), and the next release is ~/v2.sh.
-
A load balancer
market-albinus-east-1aandus-east-1b, with its own security group open on port 80, forwarding to a target groupmarket-tgthat checks/health. The servers accept port 80 from the load balancer only. -
A launch template
market-ltfromapp.sh, and an Auto Scaling groupmarket-asgthat keeps three instances from it in both zones, registered inmarket-tgand replaced when their checks fail. -
Game day, once all three are healthy. Take a zone down with the market's chaos tool, and wait until the group runs three healthy instances again:
shchaos zone-down us-east-1aThen bring the zone back with
chaos zone-up us-east-1a, and wait until the group spreads over both zones again. -
Roll
v2.shout to every instance, never with fewer than three healthy.
From the first time the shop answers, an outside check fetches it every 5 seconds. No more than 4 of those fetches may fail in all, and never for more than 30 seconds in a row. chaos status shows the count so far; resetting the lab starts it again. How quickly the load balancer notices a server is gone is yours to tune.