Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 Amazon High Availability Always On

I am using a Web & DB Instances in AWS EC2 and I want to make them high available, so that if one server fails (primary server), then another one is turned on (secondary server).

I have found lots of information for RDS high availability but not for EC2 instances that are not RDS.

  1. Could you please provide me some links for a good guide of how doing it?
  2. Could you please tell me in some words what is the process I should do in order to achive the high availability?

Thanks.

like image 345
Misha Zaslavsky Avatar asked Apr 19 '16 06:04

Misha Zaslavsky


People also ask

How do I set always on high availability?

Right click on SQL Server Services and open the Properties dialog box. Navigate to the AlwaysOn High Availability tab and select the Enable AlwaysOn Availability Groups checkbox. Restart the SQL Server Service after making these changes. Complete these steps on all your replicas.

What is availability mode in always on?

In Always On availability groups, the availability mode is a replica property that determines whether a given availability replica can run in synchronous-commit mode.

Does AWS provide high availability?

By hosting your stack on AWS, you can achieve highest levels of availability, including data center redundancy, as well as dynamic horizontal scalability in an easy and cost effective way.


1 Answers

there are several possibilities to achieve HA with EC2:

  • create an autoscaling group with min capacity=1 and max capacity=1. So whenever your instance fails, the autoscaling group will create a new one. The autoscaling group comes for free, so this is not a bad solution depending on your SLA.
  • use ec2 auto-recovery feature by creating a cloudwatch alarm that would replace your instance if failed.
  • create two EC2 instances and use Route 53 DNS failover to resolve to an healthy instance
  • Last but not least: the best solution is definitely to create several instances across several availability zones and to use an elastic load balancer to distribute the traffic. This way, even if an instance fails, you already have other ones available. AWS recommends this solution as they have an SLA of 99.95% for their instance in an AZ. By putting in several AZs you can have 100% availability

EDIT: adding information why there is no such native feature for EC2.

there is no native HA feature in EC2 compared to RDS, because EC2 is pure IaaS when RDS is more PaaS. So for RDS when you select HA, behind the scene it actually spawns a slave database in another availabilty zone and replicates your master. Whenever the master fails, you have an automatic DNS failover to the slave database, which is elected master, and a new slave database is getting created.

like image 63
Tom Avatar answered Oct 07 '22 12:10

Tom