Question

We're having a strange issue where our developers are not able to connect to the AlwaysOn Availability Group Listener when MultiSubnetFailover is set to true. However, the clients can connect when attempting to connect directly to the primary node of the group. We've reproduced this with the minimum test cast below on windows 8 using .Net 4.0.3 as well as windows 7 using .Net 4.0.3. and .Net 4.5.

We've also successfully had our staging servers connect over the group Listener, as well as using sqlcmd and SMS to connect to the vip using the MultiSubnetFailover flag. So it'd appear that the listener itself is correctly configured.

Here is the results of a nslookup on the Listener's name as well. As far as I can find online we've done everything properly but the connection still times out. Any help anyone can provide is greatly appreciated.

Update:

By process of elimination this seems to be related in some fashion to having Visual Studio installed on the developers machines.

NSLookup:

Non-authoritative answer:
Name:   sql02
Address: 10.101.2.222
Name:   sql02
Address: 10.101.1.222
Name:   sql02
Address: 10.101.0.222

Minimum Test Case:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var connection = new SqlConnection(@"                     
                Data Source              = sql02;
                Initial Catalog          = test;
                Integrated Security      = True;
                MultiSubnetFailover      = True;
                MultipleActiveResultSets = True;
                Max Pool Size            = 512;");

            connection.Open();

        }
    }
}
Was it helpful?

Solution 2

We've actually identified the issue last week.

It turns out this was a driver issue created by the development machines running Avast! as an antivirus solution. We were unable to find the magic settings that'd prevent this so we had to uninstall Avast! and are going to replace it with another antivirus.

OTHER TIPS

Try increasing your login timeout to 30 seconds and see if the connection is successful. If so, make a note of how many seconds it takes to connect. Is it around 20-22 seconds?

You can use SQLCMD.EXE to test this like this:

sqlcmd -S listener -E -M -l30

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top