Article ID: 2792139 - View products that this article applies to.
After you configure the availability group listener for an AlwaysOn Availability Group in Microsoft SQL Server 2012, you may be unable to ping the listener or connect to it from an application.
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:
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
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.
Collapse this imageExpand this image
Note You can use the SQLCMD command together with the –M parameter as shown in the screen shot to connect to the listener.
This issue occurs because your application either uses a legacy data provider that does not support the new MultiSubnetFailover parameter, or is not configured to use this parameter.
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.
You can use one of the following resolutions as applicable to your case:
When you try to connect to a listener that is defined on more than one subnet, the operation may fail if the client driver tries to connect by using one of the listener’s offline IP addresses.
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:
2855417For more information about the SQLCMD utility, go to the following MSDN website:
(http://support.microsoft.com/kb/2855417/ )Connection times out when you use AlwaysOn availability group listener with MultiSubnetFailover parameter
Introduction for the SQLCMD utilityFor more information about the SqlClient driver, go to the following MSDN website:
SqlClient support for high availability, disaster recoveryFor more information about an update that introduces support for the AlwaysOn features from SQL Server 2012 to the .NET Framework 3.5 SP1, click the following article number to view the article in the Microsoft Knowledge Base article:
2654347For more information about the driver support for multi-subnet failover, see the "5.7.1 Client-Connectivity for AlwaysOn Availability Groups" section of the following MSDN website:
(http://support.microsoft.com/kb/2654347/EN-US/ )An update introduces support for the AlwaysOn features from SQL Server 2012 to the .NET Framework 3.5 SP1
SQL Server 2012 release notesFor more information about how to create or configure an availability group listener, go to the following Microsoft website:
Create or configure an availability group listener in SQL Server 2012For more information about a connection to readable secondary error when logon Security IDs (SID) are different or missing, go to the following Microsoft blog:
Connection to readable secondary fails when login SIDs are different or missingFor more information about SQL Server multi-subnet clustering, go to the following MSDN website:
Introduction for SQL Server multi-subnet clustering
For a detailed blog post from Always On Support team about this and related issues, please check the following link:
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Article ID: 2792139 - Last Review: December 10, 2014 - Revision: 6.0