We help IT Professionals succeed at work.

Command line syntax to initiate a SQL failover in Windows 2012

What is the command line syntax to initiate a SQL 2016 failover from one node to another? I've tried:

cluster group "groupname" /move:nodeName

Thanks
Comment
Watch Question

Commented:
That should have worked, was the command runas as an administrator?
Also so this link:
https://www.mssqltips.com/sqlservertip/2713/sql-server-clustering-management-inside-the-command-line/

Author

Commented:
That's what I thought--yes, I'm running as administrator. It's returning 'cluster' is not recognized as an internal or external command, operable program or batch file.
Ora_TechieDatabase Administrator

Commented:
There are several ways to do that (all of them must be done using one of Nodes of Failover cluster)

  • Open the Failover Cluster Manager, connect to Windows Cluster, right click on the SQL Cluster Name (under 'Services and applications') and then choose 'Move this service or application node to another node')

  • Using the command prompt as you described. The error you faced seems to suggest that you are not running the command from one of the nodes and that machine doesn't have failover clustering feature installed.

  • Restart the active node (this method is least preferred); resources will be shifted to other node automatically.

Also please confirm that you tried using the command prompt or Powershell?
Commented:
When the Clustering is installed cluster.exe is added the system.  Try searching for cluster.exe in \windows\system32 or just \windows.

Do you get the same result when the following command is issued:  cluster /?

If using powershell ensure the clustering module is installed.

Powershell command list:
https://docs.microsoft.com/en-us/powershell/module/failoverclusters/?view=win10-ps

Author

Commented:
There isn't a cluster.exe anywhere. The only solution is to use PowerShell.

Commented:

Strange.

Powershell works as well.

Ensure to run Powershell as admin.