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

SQLAGListener

Primary Replica Instance

SQL01

AG Listener Name

SQLAGListener

AG Listener IP Address

192.168.1.200

AG Listener Subnet Mask

255.255.255.0

AG Listener Port Number

1433

How to do it...

Perform the following steps to create and configure an Availability Group listener:

  1. Open PowerShell ISE as an administrator.
  2. Add the following script and run it:
    Import-Module SQLPS -DisableNameChecking ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.