Configuring and Creating An AlwaysOn Availability Group in SQL Server 2012
When creating availability group listener you need to provide the below information:
· Listener DNS Name or Virtual Network Name (VNN) : This name should be unique across the domain.
· Port – The port number on which the availability group listener will listen for incoming requests. You can use the default port 1433 of SQL Server in which case the client would not be required to provide the port number when connecting. Otherwise the client will need to provide the port number as part of connection string. This port number should be defined appropriately in the firewall to allow for connections.
· Network mode – You can use either DHCP (Dynamic Host Configuration Protocol) or static IP for the availability group listener:
Here I have used DHCP but you need to use static IP addresses for the availability group listener if the availability group is spread across subnets in a multi-subnet domain. In addition, DHCP is not recommended for use in production for an availability group listener as it requires additional time to re-register if the DHCP lease expires.
On the Select Data Synchronization page, specify how you are going to synchronize your secondary replicas’ databases with the primary replica. In this case, because the database is not that large, I have chosen the first option to take a backup from the primary replica and restore them at all on the secondary replicas and for that I provided a shared location for storing the backup files which is accessible from both the primary and secondary replicas.
Alternatively you may prefer to peform the data synchronization manually or only synchronize the data if the databases are already restored on the secondary replicas, so in effect you have three data synchronization options to choose from as shown below:
On the Validation page the wizard runs the validation process to ensure that the given configuration details for the availability group can be created. In this case I chose to restore the database on the secondary replica and hence it also validates if the location for the data/log files exist on secondary replicas. If the validation fails, you can access the details by clicking the link in the Result column. Once you are finished with the validation, click Next:
On Summary page you can review your all selections and information you provided for creating and configuring the availability group. You can go back make any necerssary changes or click Finish to start creating the availability group:
Please note, using New Availability Group Wizard is not the only way to create an availability group, you can automate the process of creating an availability group by using PowerShell cmdlets or T-SQL commands. To generate T-SQL scripts for our selection or configuration information that you provided during this wizard, you can click on Script button to generate T-SQL script commands as shown in the above image for later use.
On Result page, as shown below, you can see the progress and the final status of the availability group creation process. The wizard performs a step-by-step operation for creating availability group, joining secondary replicas, taking back from the primary replica and restoring it to secondary replicas for data synchronization etc.
In the next article in the series we will examine how to connect to an Availability Group as well as maintaining and monitoring an Availability Group.