For example, when you try to connect to a listener of SQL Server by using SQLCMD, the connection times out. Additionally, you receive an error message that resembles the following:
Note These symptoms are usually intermittent, or relate to failover of the availability group resource.
The following screen shot shows an example of what occurs when you try to ping the listener for the availability of "aglisten." The screen shot also shows a successful connection to SQL Server by using the SQLCMD command when you include the multi-subnet failover parameter -M.
Note You can use the SQLCMD command together with the –M parameter as shown in the screen shot to connect to the listener.
This parameter is supported in newer versions of the SQLClient driver that is included with the Microsoft .NET Framework 4 and with later versions of the .NET Framework, and is back ported to the Microsoft .NET Framework 3.5.
Note The PING command is a simple connectivity testing tool that does not support the new parameter.
- To resolve this situation when the data providers support the MultiSubNetFailover parameter, add the MultiSubNetFailover parameter to your connection string, and set it to true.
- To resolve this situation when your legacy clients cannot use the MultiSubnetFailover property, you can change the listener’s RegisterAllProvidersIP value to 0. To do this, run the following command from the Windows PowerShell command-line interface:Import-Module FailoverClusters
Get-ClusterResource <Your listener name>|Set-ClusterParameter RegisterAllProvidersIP 0
When a listener is created, an IP address is designated for each unique subnet that an availability group replica is hosted in. For example, if a listener is created for an availability group that has replicas that exist in two subnets, two IP addresses are defined in the listener. One address is used by an application that can connect to an instance of SQL Server in subnet 1, and the other address is used when an application connects to an instance of SQL Server in subnet 2.
Behind the scenes, the listener creates a Windows cluster "Client Access Point" resource. One of its properties is RegisterAllProvidersIP. When a listener is created, this is set to 1, and all the listener’s IP addresses are registered in DNS server. This configuration provides reduced re-connection time for clients.
Because the DNS record contains all the IP addresses, a client that tries to connect to the listener must know how to handle this situation. The MultiSubnetFailover parameter enables the client driver to try connections in parallel to all the listener’s IP addresses. Without the MultiSubnetFailover parameter, the client driver will try to connect sequentially to all IP addresses for the listener. Sequential connections may cause a long logon time or logon time-outs.
Note The problem that is mentioned in this article also affects Microsoft SharePoint environments that are configured to use an AlwaysOn Availability Group’s secondary read-only replica. To resolve this issue, perform whichever of the following actions applies to your version of SharePoint:
- For Microsoft SharePoint 2007: This is classified as a legacy application. Therefore, SharePoint 2007 cannot be configured to use the MultiSubnetFailover parameter. Instead, you have to use the Windows PowerShell command that is described in the "Resolution" section.
- For Microsoft SharePoint 2010: Cumulative update packages are now available that add support for the MultiSubnetFailover parameter. For more information about the update packages, click the following article numbers to view the articles in the Microsoft Knowledge Base:
For a detailed blog post from Always On Support team about this and related issues, please check the following link: