Configuring HA with DR in AWS IAAS services.

Ajaykumar
6 min readMar 11, 2021

Launch 4 AWS EC2 machines .one for Active directry Domain server and Two server for Always on ,one for DR server.

Install Active Directory

→Use the following steps to install Active Directory on the server:

Adserver Ip: 13.127.206.135

Server 1 : WIN-D9QS8DEVDUV (15.207.14.40 )

Server 2 :WIN-6KP09JBBLUN (13.235.132.218).

Steps:

  1. Open the Dashboard in the Server Manager, and click on the Add roles and features links from right hand side panel of the screen.

2. You should be able to see Add Roles and Features Wizard screen. Check the Skip this page by Default check box and press Next button.

3. In the following screen, you will be asked to select a destination server from the server pool and press Next button

4.On the Select Server screen, Select the role Active Directory Domain Services. Once you selected the role, you will be promoted to install the prerequisites. Check the Include management tools(If applicable) check box and press Add Features button.

5.Active Directory Domain Services will be installed. Press Next button to continue.

Select the Add new a Forest button and provide Root domain name in the text box. Press Next button to continue

Enter the Password of your choice in Password and Confirm password fields and Keep other settings on default. Press Next button to Root domain name in the box . Press Next button to continue.

→ Add two server into domain controller.

Server 1 : 15.207.14.40

Server 2: 13.235.132.218.

Install the Windows failover cluster:

Check failover cluster:

Open Run -clustadmin.msc

Always on Configuration :

To enable AlwaysOn feature, Open SQL Server Configuration Manager, Right-click SQL Server instance and go to properties,
Select AlwaysOn High Availability tab section and tick checkbox for Enable AlwaysOn AvailabilityGroups

Note: — We also need to make sure nodes where we will enable AlwaysOn feature is part of Windows Failover Cluster.

Once we enabled, Apply and Click OK. Restart the SQL Server services.

As shown in the following fig. we will able to use SQL Server AlwaysOn High Availability feature. Right-click Availability Groups and Click New Availability Group.

Configuring Availability Group :
An AlwaysOn Availability Group contains a set of user databases; we need to select user databases which will be part of the Availability group. These databases called as an Availability database.

Availability Group name and click Next

Databases must be in full recovery model and atleast take one full backup .

Next, Specify Replica step has four sections. Replica, Endpoint, Backup Preferences, and Listener

Replica– Replica is a server. There are one primary replica and multiple replicas. In SQL server 2012, It supports up to 4 secondary replicas, while in SQL Server 2014, it supports up to 8 replicas.

The primary replica is primary source server or production server. A secondary replica is a server which maintain a backup copy of the primary server availability database. On the Primary replica, it allows to perform Read and write operations while on the secondary replica only read operations.

In this case, SQL1 is our primary replica and SQL2 is a secondary replica. So, we will add SQL2 as a secondary replica as shown in the following fig.

Initial Role — It specifies the role of replica whether Primary or secondary.

Automatic Failover — It failovers functional role from primary replica to secondary replica by an automated method with no data loss.

Synchronous Commit — In the Synchronous-commit mode, failover can happen by either Automatic or manual way with no data loss. So, in this case, we will use synchronous commit with automatic failover.

Once clicked Add Replica, connect to the server, Select WIN-6KP09JBBLUN

On the secondary replica, we can only take a log backup, and Copy-only backup, Differential, and Full back up are not allowed on a secondary replica. While on the primary replica, we can perform Full, log, and Differential backups.

We have taken the full and log backup on primary server and restore to database with no recovery in replica .

In the Validation step, SQL Server performs validations against any required actions, and It will provide warning or error messages for missing required steps.

we will verify the database at secondary replica WIN-6KP09JBBLUN. As we can observe, Database ABCD ,Adventure is in Synchronizing state, and it is in sync with the primary replica, and we can read data successfully.

Configure log shipping on Always on server.

Hostname : WIN-6KP09JBBLUN (Always on Primary replica)

Hostname : DRSREVER (Logshipping secondary server).

Database Name : ABCD

→Now, right click on the database in SSMS and select Properties. Then select the Transaction Log Shipping . Check the “Enable this as primary database in a log-shipping configuration” check box.

→We can added primary server Shared backup folder and folder.

Next, configure the secondary instance and database. Click on the Add button to configure the Secondary Server instance and database. You can add servers .

Transaction log-shipping dashboard report on the AlwaysOn Primary replica and on the secondary server in the DR site to monitor backup status. You can see both the databases in primary and secondary are completely in sync in the below screenshot.

--

--

Ajaykumar

Enriched with 6+ years of experience in IT with enhanced skills in Database Administration, Cloud Technologies like AZURE, AWS. Specializing in high volume