Creating an Availability Group listener
In this recipe, we will create an Availability Group listener for an Availability Group.
Getting ready
We will use the following information for this recipe. You will need to change these values based on your environment configuration:
Configuration |
Value |
---|---|
Availability Group (AG) Name |
|
Primary Replica Instance |
|
AG Listener Name |
|
AG Listener IP Address |
|
AG Listener Subnet Mask |
|
AG Listener Port Number |
|
How to do it...
Perform the following steps to create and configure an Availability Group listener:
- Open PowerShell ISE as an administrator.
- Add the following script and run it:
Import-Module SQLPS -DisableNameChecking $AGName = "SQLAG" $AGListenerName = "SQLAGListener" $AGListenerPort = 1433 $AGListenerIPAddress = "192.168.1.200" $AGListenerSubnetMask = "255.255.255.0" $primary = "SQL01" #server object $server...