1

I'm reading some articles on how to create an Always on Availability Groups - Disaster Recovery (HA + DR) environment. In many blogs it shows that to create this environment I will need three servers, as shown in the figure below.

Where would SQLP3 be the Disaster Recovery server

enter image description here

In other blogs, it informs that I need to have only two Servers to build the environment of (HA + DR).

In fact, I only need 2 servers, as shown below?

enter image description here

Thanks.

Carlos D
  • 21
  • 1
  • 3

1 Answers1

1

One of the main differences between the two configurations is automatic failover mode. Automatic failover allows for higher availability by automatically promoting one of the secondary replicas to the primary replica, when the previous primary replica goes down.

A minimum of 3 servers are needed to be configured in the same cluster in order to enable automatic failover. This is because a majority vote (quorum) must be agreed on between the servers in the same cluster in order to automatically promote a secondary to the primary. When there's only 2 servers in a cluster, there can never be a majority vote if one of those servers goes down (1 out of 2 is not considered majority).

Without automatic failover, you still have some lever of HA/DR even in a 2 node cluster, but you'd have to manually failover in a disaster.

J.D.
  • 37,483
  • 8
  • 54
  • 121
  • Thanks for the feedback @J.D, wow.... So I'm going to have problems implementing this scenario here at the company, because there's a lot of hardware that will be idle.

    If I understand correctly, I will have an instance with the production bases (Primary Replica), and will I also need to have two more servers (Secondary Replica) with two more instances and with the same hardware, which will practically be unused?

    – Carlos D Jun 13 '22 at 21:00
  • 1
    @CarlosD To each their own, some people use the extra instances (secondary replicas) for read-only queries for apps and reporting to improve performance, other people can tolerate a few minutes of downtime during an event to manually failover & therefore don't create more than a 2 node cluster. It just depends on your use cases and RTO. Also, you don't have to provision the other servers with the same exact hardware as your primary. They can be minimally provisioned (e.g. 8 GB of Memory, 2 cores of CPU) but obviously you need a plan to easily increase that provisioning during a failover event. – J.D. Jun 14 '22 at 00:40
  • @J.D.everything correct. Just a note: if you make secondary readable, you have to pay licenses for them. – user_0 Jul 05 '22 at 09:48
  • @user_0 Right, which is why I mention you can minimally provision them, so you can save on licensing costs too. Though my previous comment is slightly incorrect, as now I believe Microsoft raised the minimum amount of cores you have to license to 4 cores. But if your primary is a 16 core server, licensing a 4 core secondary will surely be a lot cheaper. – J.D. Jul 05 '22 at 12:31
  • @J.D. You said i need to use at least 3 servers to have automatic failover, but i set it up with only 2 servers, primary replica and secondary replica and it worked automatic failover, can i use only 2 servers? Tks. – Carlos D Nov 18 '22 at 15:17
  • Also note if you make a synchronous secondary readable, you increase the chances of HADR_SYNC_COMMIT waits screwing up your production system. If you want a readable secondary, an asynchronous will get you in far less trouble performance wise. Licensing... yeah, pay up. – Anti-weakpasswords Nov 21 '22 at 05:10