Windows Cluster with AG

  • So I have a 2012 windows cluster with three nodes. Each node has sql 2012 Enterprise sp1. We have been playing around in our lab environments trying things out, and we blew it up. The listener points to the primary sql server, but the windows cluster points to a secondary. Also in cluster manager it shows current host server as our secondary as well. I am trying to figure out what needs to be done to get the current host back to the primary. I have tried a few things, including this: http://technet.microsoft.com/en-us/library/ee461002.aspx No luck.

  • Hi Sarah,

    A recap and some clarifying questions I have for you:

    - You have a three node Windows Server Failover Cluster

    - You have three SQL Server instances - one per node? And are they standalone instances or Failover Cluster Instances?

    - You created an Availability Group that spans all three SQL Server instances?

    - Which instance hosts the read-write replica and which WSFC node does that instance currently "live" on?

    - You created an AG Listener associated with the Availability Group

    - Can you clarify what you mean by "windows cluster points to secondary"? You're seeing that the AG resource in Failover Cluster Manager is owned by a SQL Server instance hosting a secondary replica?

    Thanks,

    Joe

  • - You have a three node Windows Server Failover Cluster -- Yes

    - You have three SQL Server instances - one per node? And are they standalone instances or Failover Cluster Instances? -- Standalone, one per node

    - You created an Availability Group that spans all three SQL Server instances? - Yes one AG with 2 databases

    - Which instance hosts the read-write replica and which WSFC node does that instance currently "live" on? -- Should be TestSql01

    - You created an AG Listener associated with the Availability Group -- Yes AO01

    - Can you clarify what you mean by "windows cluster points to secondary"? You're seeing that the AG resource in Failover Cluster Manager is owned by a SQL Server instance hosting a secondary replica? -- Cluster manager it says "Current Host Server: TestSql02", so when I connect in SSMS to the listener and do @@servername I get TestSql01, when I use the cluster name I get TestSql02.

  • So if you go in Failover Cluster Manager and expand "Services and Applications" and click on the Availability Group name - what do you see under "Current Owner" vs. "Preferred Owners"?

    Assuming you have not configured read-only routing, and you're using the AG Listener name to connect via SQL Server Management Studio, you should be landing on the read-write primary replica - and you'll see the SQL Server instance hosting that replica via @@SERVERNAME.

  • We were able to resolve this by in the Failover Cluster Manager navigating from the cluster name to More Actions -> Move Core Cluster Resources -> Select Node and picking SQL01. Not sure why powershell wouldn't work.

  • For availability groups - you don't want to manage them using Failover Cluster Manager - you want to manage them using T-SQL commands.

    I suspect we have a mismatch on what we're discussing (using different terminology).

    An example hierarchy...

    Windows Server Failover Cluster (WSFC)

    WSFC Node 1

    SQL Instance 1

    Availability Group 1 - Primary (read-write) Replica

    Database 1

    Database 2

    WSFC Node 2

    SQL Instance 2

    Availability Group 1 - Secondary Replica (Read-Only or Not)

    Database 1

    Database 2

    WSFC Node 3

    SQL Instance 3

    Availability Group 1 - Secondary Replica (Read-Only or Not)

    Database 1

    Database 2

    And "Availability Group 1" would have a listener associated with it. If connecting to the listener without read-only routing enabled, you'll connect to the primary read-write replica. In this example, I would have connected to "SQL Instance 1" on WSFC Node 1.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply