Overview:
SQL server always on Availability group is a new feature developed in SQL server 2012 on the basis of SQL mirroring and Windows server failover clustering. So the environment must achieve the same requirement of the windows server failover clustering and SQL Installation. For configuration of a fail over cluster, Environment should be configured with a domain network .For the best practices configure the Domain network with 2 Node domain controller.
Prerequisites
- Domain controller
- Windows server 2012 or windows 2008 r2 ( Enterprises or data-center)
- SQL server 2012
- Shared storage
Scope:
- Configure the single node domain controller
- Install SQL server on each machine
- Configure the Windows fail over cluster in SQL nodes
- Enable the SQL server Always on Availability Group
- Creating a Always on Availability group and listener
- Adding a Secondary read write Replica in the Environment
- Adding a third node with read only replica
Configuring Windows Server Failover Clustering
Install fail over cluster feature in windows server
- Make sure all SQL NODE is configured as a domain member server
- Configure the shared storage and initialize the disk in all SQL nodes
- Open server manager in SQLNODE1
- Click on the feature in and click add feature
- Select fail over cluster and click next
- Repeat this step in both SQLNODE2 and SQLNODE3
Validate the Cluster requirement
- Open fail over cluster manager in any one of the cluster node
- Click “Validate a configuration” and click on next
- Click browse button and enter the server name , Click OK to select the server then next
- On testing option page select “ Run all test recommended” and click next
- Ignore the” IP WARNING MESSAGE “
- Once it is completed click finish to close the page
Creating Fail over cluster
- Open fail over cluster manager in any one of the cluster node
- Click create a cluster link
- Click browse button and enter the server name , Click OK to select the server then next
- Enter the cluster name of the cluster (Eg: SQLHACL1)
- Remove the tick mark on the DHCP
- In the address box enter the Cluster IP address and click next.
- For the best practices Make sure the IP address should be in the same subset
- On the summary page click finish
Always on availability Group
Configure always on availability group
- Open SQL configuration manager in SQLNODE1
- Take the properties of the instance ( Default MSSQLSERVER”)
- Select the proper account in the logon tab and enter the password for the account
- Please enter a domain level account
- On the always on high availability tab click the check box to enable the availability group
- Close the both warning
- Restart the SQL service from the SQL configuration manger window
- Do the same on both SQLNODE2 and SQLNODE3
- Enter the same account in Every node
Making Always on availability for a Database
Note: Please ensure that database are configured in full recovery mode
- Open SQL management studio in SQLNODE1
- Ensure that database recovery mode is set to full
- Take a backup of the database using SQL backup window
- Expand Always on high availability node tab in management studio
- Right click and select “New availability Group wizard”
- Enter the name of the availability group (Eg:SQLHA-1)
- On the Select Databases page , click the check box to select the Data base
- In the replica page select SQLNODE2
- Automatic fail over : Select both node (Node1 and node 2)
- Synchronous Commit: Select both node (Node1 and node 2
- Click next to finish the configuration
Availability Group Listener
- Availability Group Listener
- Open sql management studio in SQLNODE1
- Expand Always on high availability node and navigate to SQLHA-1
- Click right button and select add listener
- Type a DNS name for the listener (eg: SQLHA-1 listener)
- Port :1433 ( Ensure port is opened )
- Network mode static
- Add IP address for the Listener
- Make sure the ip address should be in the same subset
- Click OK to Create and finish the wizard
Note: Verify the service name under the fail over cluster manager