For a particular service, I need to run a single EC2 instance in a fault tolerant way.
Only in case of errors I want that the "primary" machine is terminated and the traffic must be be redirected on "secondary" machine within some seconds and automatically. This is the classic case of a primary and secondary server with the constraint that the secondary server must not work unless the primary crashed.
I'm quite new in this world but as far as I understood, with Elastic IP I need to manually change the binding if the primary machine hangs. Instead, with Auto Scaling, ELB and CloudWatch I can:
- Set up an auto scaling park with 2 machine, but the traffic will be load balanced (sticky sessions is not what I want because I need all the traffic on the primary machine if it works)
- Set up an auto scaling with just 1 machine, so if the primary machine hangs automatically a new one will be online. However as far as I know the boot process needs several minutes.
Any advice on how I can combine AWS services to achieve this goal?