SQL Server Clustering Management inside the command line

Problem

Experienced SQL DBA’s know their way around Failover Cluster Manager fairly well. The graphical tool is a great, but what kind of management tasks can I do when my Failover Cluster Manager freezes or something prevents me from starting the program?  In this tip we cover a few of the command line options for getting cluster status as well as for failing over.

Solution

There are numerous commands you can run to manage a SQL Cluster from the command line. Below I’ll show you a few of these that include status checks and how to failover.

How to View SQL Clusters

This can be run from your workstation to view all SQL Clusters on the network you are connected to.

cluster /list

Cluster List

View Status of Nodes

You can run this to view the status of all nodes in the cluster.

cluster node
–or
cluster node /status

Cluster Node

View Status of Cluster Groups

You can run this to view the status for all cluster resource groups.

cluster group
–or
cluster group /status

Cluster Group

View Status of Cluster Networks

You can run this to view the cluster networks status.

cluster network
–or
cluster network /status

Cluster Network

View Properties of All Network Interface Devices

You can run this to view the status for all network interface devices.

cluster netinterface
–or
cluster netinterface /status

Cluster Netinterface

View Status of Cluster Resources

You can run this to get a listing of all available cluster resources.

cluster resource
–or
cluster resource /status

Cluster Resource

Failover Service to a New Node

You can run this to initiate a failover.

cluster group “groupname” /move:nodeName

Failover

In the figure above you can see where “SQL Server (ECS)” was moved to “TSTPSSQLCL04”.

Next Steps

  • This tip only showed a few of the commands you can run against a SQL Server Cluster. To find more command you can run this command “cluster /?”
  • To view more tips about SQL Server Clustering check out the MSSQLTips library

Leave a Reply

Your email address will not be published. Required fields are marked *