HiveBrain v1.2.0
Get Started
← Back to all entries
snippetModerate

How to determine high availability configuration is working correctly

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
howhighworkingavailabilitydetermineconfigurationcorrectly

Problem

I am in the process of setting up always on high availability clusters for the first time. Can anyone explain to me from the networking perspective after configuring the group and testing to make sure it is functioning properly, how does SQL know when to fail over, and how would my application connecting to the SQL server know where it is pointing?

So for example I have an application foo connecting to a named instance DB01.FOO. When foo fails and is rolled over to DB02.FOO, how would my application know it should be talking to DB02.FOO?

DB02.FOO is in the same domain but a different server. I am just trying to wrap my head around all aspects of this before attempting it. If there are any links someone would recommend that would be awesome as well.

Solution

how does SQL know when to fail over

There is a Flexible Failover Policy which you can use to adjust the sensitivity to the criteria that will trigger a failover. The default is FAILURE_CONDITION_LEVEL = 3 which means "critical error, server unresponsive, or server down." You can see more details here and here.


how would my application ... know where it is pointing

If your availability group listener is properly configured, the connection string should not need any further knowledge to always connect (even if after a retry) to the primary replica on a specific server - it does not need to know those implementation details at all. All it needs to do is point at the listener, and the listener determines if the primary replica is currently on DB01 or DB02. This is pretty powerful since it lets you adjust your AG configuration and move replicas all over the place without ever having to touch the applications (except in cases where you (a) add a replica with read-only intent or (b) have to move the listener). You can see more details here.

Context

StackExchange Database Administrators Q#20444, answer score: 11

Revisions (0)

No revisions yet.