An availability group supports a fail over environment for a discrete set of users databases, know as availability databases, that fail over together. An availability group supports a set of primary databases and one to eight sets of corresponding secondary databases. Secondary databases are not backups. Continue to backup your databases and their transaction logs on a regular basis.
We have two node windows failover cluster SQL1 & SQL2 already setup as shown in the below screenshot
Once you have installed failover cluster we can now proceed with enabling the AlwaysOn Availability Group features in SQL Server 2012. This needs to be done on all the SQL Server instance that you will configure as replicas in your Availablity Group
Step 7
In the Endpoints tab, verify that the port number value is 5022 and endpoint name Hadr_endpoint
Step 8
In the below screenshot, Select backup preferences
Step 9
In the Listener tab, select the Create an availability group listener option. Enter the following details.
Listener DNS name: AGLIS01
Port: 1633
Listener IP Address: 192.168.35.18
Click the Add... button to provide an IP address. In the Add IP Address dialog box, enter the preferred virtual IP address in the IPv4 Address field. Click OK. Click Next.
Step 11
In the Validation page, verify that all validation checks return successful results. Click Next.
Step 12
In the Summary page, verify all configuration settings and click Finish. This will create and configure the AlwaysOn Availability Group and join the databases.
Prerequisites required to enable SQL Server 2012 AlwaysOn Availability Groups Features
- Get the OS installed, patched and configured on all participating node.
- See either Windows Update or an internal Windows Server update Services (WSUS) server to get all the required Windows Updates downloaded and installed.
- Dedicated domain user account be created for use by the SQL Server service. This should just be a regular or domain account.
- Having separate accounts for SQL Agent service, SSAS, SSIS & SSRS. Having separate account is more secure and resilient, since a problem with one account won't affect all the SQL Server services.
- Ensure password is not temporary and there is complex password.
- Both SQL & OS editions, versions should be at same level on all participating nodes.
- All replicas in your AlwaysOn group must be in the same windows domain. They must be able to communicate with each other.
- Always on availability groups is only supported in Enterprise edition starting from SQL Server 2012 (except SQL Server 2016 it supports basic availability group in standard edition)
- Recommend to have same collation on all replicas
- SQL Server ports must be opened at firewall level for communication between replicas
- Create shared network share on all participating node
- Need to install .NET framework 3.5.1 or greater on all participating node
- Make sure the databases are in FULL recovery mode
- Databases included in AlwaysOn group must be user databases. System databases cannot participate in AlwaysOn Availability group
- Read only databases cannot belong to an AlwaysOn group
- Databases may only belong to one availability group at a time
- Make sure full backups of each databases are made prior installing AlwaysOn
- No cluster shared volume is required for Always On, it can be configured in local disks
- Make sure to have a separate NIC's for public and private communication
- Additional NIC is required if want to isolate always on replication traffic to dedicated NIC
- Make sure to have two free IP's each for windows cluster IP and Always on listener IP
We have two node windows failover cluster SQL1 & SQL2 already setup as shown in the below screenshot
Once you have installed failover cluster we can now proceed with enabling the AlwaysOn Availability Group features in SQL Server 2012. This needs to be done on all the SQL Server instance that you will configure as replicas in your Availablity Group
How to Enable SQL Server 2012 AlwaysOn Availability Groups Feature
Default standalone SQL instances installed on nodes SQL1 & SQL2
Step 1
Open SQL Server Configuration Manager. Double click the SQLServer (MSSQLSERVER) service to open the properties dialog box
In below screenshot, AONTESTWFCS01is the windows cluster name. SQL1 and SQL2 are nodes.
Step 2
Restart the SQL Server service
Step 3
To create and configure a SQL Server 2012 AlwaysOn Availability Group, Open SQL Server Management Studio. Connect to the SQL Server instance
In Object Explorer, expand the AlwaysOn High Availability folder, Right click on the Availability Groups folder and select the New Availability Group Wizard... option. This will launch the New Availability Group Wizard
Step 4
In the Introduction page, click Next.
In the Specify Availability Group Name page, enter the name of the Availability Group in the Availability group name: field. Click Next
Step 5
In the Select Databases page, select the checkbox beside the database that you want to include in your Availability Group. The databases have to be in Full recovery model prior to joining them in the Availability group. Click Next.
Step 6
In the Specify Replicas page, under the Replicas tab, click the Add Replicas button and connect to the other SQL Server instances that you joined as nodes in your Windows Server Failover Cluster.
Configure the following options:
- Automatic Failover
- Synchornous commit
- Readable secondary
Step 7
In the Endpoints tab, verify that the port number value is 5022 and endpoint name Hadr_endpoint
Step 8
In the below screenshot, Select backup preferences
Step 9
In the Listener tab, select the Create an availability group listener option. Enter the following details.
Listener DNS name: AGLIS01
Port: 1633
Listener IP Address: 192.168.35.18
Click the Add... button to provide an IP address. In the Add IP Address dialog box, enter the preferred virtual IP address in the IPv4 Address field. Click OK. Click Next.
Step 11
In the Validation page, verify that all validation checks return successful results. Click Next.
Step 12
In the Summary page, verify all configuration settings and click Finish. This will create and configure the AlwaysOn Availability Group and join the databases.