Always-on AG configurations

Enable backup

Create a new Database called “Database” (open SSMS and click create new database) and do a full backup for this database (right click Tasks->Backup).

You don’t need to do this step on the second node, since you will set this database to be part of the AG.

In other cases, it’s best practice to have backup even if you have HA solution.

Enable Always-on

  1. Open SQL Server Configuration Manager and enable the Always on checkbox stormtroopocat

Create Availability Group

Open SSMS and create the first Availability group

Step by step

Result:

stormtroopocat

Done.

Test the HA

Open the SSMS right click and simulate failure

or Hard shutdown the active instance from Amazon EC2 Console

test-failover

Fine tuning

  1. Open dnsmgmt.msc Look for the endpoint record, how many records do you see? How to solve it?

    See solution

  2. When failover, you might notice that the cluster is trying to set the wrong IP on the instance, since only one IP can run on one instance, we can set the cluster to try running those IP only on the instance that is relevant

    See solution