SQL Server: Setting up Quorum Node Weight in a Windows Server Failover Cluster

I had a request coming in where I was asked to demo the capabilities of AlwaysOn feature using Availability Groups in SQL Server 2012 (a note on what is availability group deserves an explanation and a separate blog post, till that time you can read an introductory post which I had written here)

I will assume that you have configured a WSFC (Windows Server Failover Cluster). At time of writing this blog, I had a two node failover cluster at same site (single site) which I had created using Windows Server 2008 R2 and the quorum model used was Node + Disk. To get know more about Quorum you can check this wonderful article at MSDN here. Note that you will be required to apply this hotfix to configure a cluster node that does not have quorum votes.

   

Now using powershell you can not only view but also administer the failover cluster and its resources. I will be using powershell v3.0. Setting up a node weight is very easy and in a matter of few lines of code you can get the cluster and the quorum model up and running.

$cluster=Get-Cluster

$node=Get-ClusterNode-Cluster $cluster
(Get-ClusterNode-Cluster $cluster -Name‘Node name goes here’).NodeWeight=1

No marks for guessing here, but if you have been using v2.0 of powershell, and wondering that why I have not imported the “FailoverClusters”module in this sessions, the answer is all necessary modules are imported at run time required for any cmdlets. This is a new feature introduced in the v3.0 of powershell.

You can repeat this script in all the nodes which you desire to have voting rights in your single site or multi-site setup just by changing the name of the respective node in the cluster.

In order to verify the change that this script has made, I executed a DMV in the SQL Server Management Studio and verified the values in the column number_of_quorum_votes

use master
select*from sys.dm_hadr_cluster_members

 

 
Regards

Raunak Jhawar

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook

   

Leave a Reply

Your email address will not be published.