5

I have set up an AlwaysOn with a primary and secondary replica on different subnets but I have been forced to use Registerallprovidersip set to 1. This causes the listener to only have 0 IP address in DNS which means I am at the mercy of DNS replication when a failover event occurs as it will take sometime for the listner's IP to update.

Has anyone in a similar situation found ways to improve failover time?

2

You should modify the registerallprovidersip setting in conjunction with changing the time to live (TTL) for the records.

Without modifying the default TTL, the registration lives too long. Sadly there is still a delay but dramatically reducing the TTL helps.

Ideally you should see what you can do to get the client connections to specify multi subnet failover and not have to do this workaround. But with the TTL being lowered, you should be fine, I've done that with several clients and it all works out alright. It still won't instantaneous.

You can see more about these settings working in conjunction with each other here.

  • Sadly I was forced down the route due to the application uses OLEDB which does not have a multisubnetfailover connection parameter. The other issue is that the primary and secondary replica are geographically seperated and are managed by seperate domain controllers so this means I need to wait for DNS replication across domain controllers which is the biggest delay as the minimum replication time is 15 minutes. – totalfreakingnoob Nov 25 '16 at 14:28
1

I am in similar situation ... wherein we are at the mercy of DNS update which my company has a global policy of 20 mins. We have [HostRecordTTL] = 300 and [RegisterAllProvidersIP] = 0 due to legacy application.

Below script will generate commands for all the primary replicas (primary after failover) :

##### Author: Kin Shah ##############################################################
#run below tsql to update the cluster network name when the failover happens.
# In my company the global DNS cache updates every 20 mins .. 
# This was used to re-register / force the Listener device register with the local DC
# registers the Network Name resources of the local cluster with a DNS server  and does not interrupt cluster availability.
#CommandToRun_PowerShell column in the script output will provide the command to be run on the primary replica (the primary after failover) !

SELECT
   'Get-ClusterResource ' +AGC.name+'_'+AGL.dns_name + ' | Update-ClusterNetworkNameResource' as CommandToRun_PowerShell-- this is the meat !!
 , RCS.replica_server_name
 , ARS.role_desc
 , AGL.dns_name
FROM
 sys.availability_groups_cluster AS AGC
  INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS
   ON
    RCS.group_id = AGC.group_id
  INNER JOIN sys.dm_hadr_availability_replica_states AS ARS
   ON
    ARS.replica_id = RCS.replica_id
  INNER JOIN sys.availability_group_listeners AS AGL
   ON
    AGL.group_id = ARS.group_id
WHERE
 ARS.role_desc = 'PRIMARY'
  • This is really good. Thanks for sharing. Do you have any thoughts about how you could hurry replication to other domain controllers as well? – totalfreakingnoob Dec 12 '16 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.