When a cluster contains an even number of voting nodes, you should configure a witness. Adding a witness vote enables the cluster to continue running if half the cluster nodes simultaneously go down or are disconnected. A file share witness is a type of quorum witness that uses a Server Message Block (SMB) file share to maintain cluster information in a log file. This file share can be hosted on a server, USB storage, or Network Attached Storage (NAS).
The file share witness is also beneficial for multisite clusters with replicated storage.
You might use a file share witness when:
-
A Cloud Witness can't be used because your cluster nodes don't have a reliable internet connection or an internet connectivity.
-
A disk witness can't be used because there aren't any shared drives to use for a disk witness. For example, a Storage Spaces Direct cluster, SQL Server Always On Availability Groups (AG), or Exchange Database Availability Group (DAG). None of these types of clusters use shared disks.
In this article, learn how-to configure a file share witness for your Failover Cluster.
Prerequisites
Before you can use a file share witness, you must have the following prerequisites in place:
-
The Failover Cluster feature must be installed and configured on your device. To learn more, see Install or Uninstall Roles, Role Services, or Features.
-
You have the Full Control permission on the Failover Cluster.
-
Administrative credentials to configure a file share on the witness device.
-
A device to host the file share witness supporting SMB 2 or later.
-
If you're using a non-domain joined device for the file share, your cluster must be running Windows Server 2019 or later.
-
The device hosting the file share witness must have a minimum of 5 MB of free space.
Warning: The use of Distributed File System (DFS) or replicated storage technologies isn't supported with failover clustering. DFS can cause a partition-in-space or partition-in-time, where the cluster nodes are running independently of each other and could cause data loss.
Configure the file share
When configuring a file share witness for the cluster quorum, the file share:
-
Must be dedicated to the single cluster and not used to store user or application data.
-
A single file server can be configured with multiple file shares to use as a witness for multiple clusters.
-
Should be physically separate from the cluster nodes or cluster sites. For example, consider the separation of network, power, rack, and rooms if necessary. Separation allows opportunity for cluster nodes or sites to survive if network communication between them is lost.
-
You can use a separate Failover Cluster for high availability of the file share.
The file share witness can be hosted on a domain-joined Windows device or a non-domain joined device, for example:
-
NAS devices.
-
Windows devices joined to a workgroup.
-
Routers with local USB storage.
The steps to configure the file share witness are different depending on the type of device hosting the file share. To create the file share, select the relevant tab for your scenario.
Domain-joined Windows device
To configure the file share witness on a domain-joined Windows device, follow these steps:
Important: The SMB file share must be hosted on a Windows server joined to the same Active Directory forest as the cluster.
-
Right-click Start, select Computer Management.
-
In the Computer Management console, expand System Tools > Shared Folders.
-
Right-click Shares, select New Share.
-
On the Create A Shared Folder Wizard, select Next to begin.
-
Enter the path to the folder that you want to share or select Browse to locate a folder, then select Next.
-
Enter a name for the Share name, then select Change to configure the offline settings. Adding a description for the share is optional.
-
Select No files or programs from the shared folder are available offline. Select OK, then select Next.
-
Under Shared Folder Permissions, select Customize permissions, then select Custom.
-
Select Everyone, then select Remove.
-
Select Add, enter the name, or locate the Cluster Name Object (CNO) for the cluster or suitable Active Directory group containing the CNO. Then select OK.
-
Select both Change and Read permissions.
-
Select the Security tab, then select Advanced.
-
In the Advanced Security Settings screen, under the Permissions tab, select Add.
-
Select Select a principal, and then enter the name or locate the Cluster Name Object (CNO) for the cluster or suitable Active Directory group containing the CNO. Select OK.
-
Under Basic permissions, select Modify, Read & execute, List folder contents, and Read. Then select OK.
-
Confirm and configure any other folder permissions to meet your organization's requirements. Select OK for each dialog until you return to the Shared Folder Permissions screen.
-
Select Finish to create the share.
Now you have a file share on a domain-joined Windows device with the necessary permissions per your organization. Proceed to the next step to configure the cluster quorum settings.
Non-domain joined device
To configure the file share witness on a non-domain joined device, follow these steps:
Important: If you're using a non-Windows device, consult your vendor documentation for how to create local accounts and configuring an SMB share on your device. These steps are generalized.
-
Sign in to your device as an administrator.
-
Create a local account on the device for the cluster to use to authenticate the file share. Store the credentials in a secure location.
-
Create an SMB file share on the device that uses the SMB 2 or later protocol.
-
Update the share permissions to remove all users and groups except the new local account and any permissions required to meet your organization's requirements. The new local account should have the Change and Read permissions.
-
If necessary, modify your file system permissions. Grant the new local account Modify, Read & execute, List folder contents, and Read permissions as applicable to your file system. The local account must have write access.
-
Confirm and configure any other folder permissions to meet your organization's requirements.
-
Complete any further steps to create the file share.
Now you have a file share on a non-domain joined Windows device with the necessary permissions per your organization. Proceed to the next step to configure the cluster quorum settings.
Configure the cluster quorum
You can configure the cluster quorum settings by using Failover Cluster Manager or the FailoverClusters PowerShell module.
Domain joined Windows device
To configure the cluster quorum to use a file share witness on a domain joined device using Failover Cluster Manager, follow these steps:
-
In Server Manager, select Tools, then select Failover Cluster Manager.
-
On the left pane, under Failover Cluster Manager, select the cluster that you want to configure.
-
On the right pane, under Actions, select More Actions, and then select Configure Cluster Quorum Settings.
-
Under the Configure Cluster Quorum Wizard, select Next.
-
Under Select Quorum Configuration Option, select Select the quorum witness, then select Next.
-
Under Select Quorum Witness, select Configure a file share witness, then select Next.
-
Under Configure File Share Witness, type the file path location or select Browse, select Browse again and locate the file share to use as the witness resource. Then select Next.
-
Under Confirmation, review your configuration and select Next.
-
After the wizard runs, the Summary page appears. If you want to view a report of the tasks that the wizard performed, select View Report. Select Finish to complete your configuration.
Note: After you configure the cluster quorum, we recommend that you run the Validate Quorum Configuration test to verify the updated quorum settings.
Non-domain joined device
Here's how to configure the cluster quorum to use a file share witness on a non-domain joined device. A non-domain joined file share witness can only be configured from PowerShell using the Set-ClusterQuorum cmdlet.
Sign into the device that has the Failover Cluster Management Remote Server Administration Tool (RSAT) installed or on a server where you installed the Failover Cluster feature. Perform the following steps:
-
Open an elevated PowerShell window.
-
Run the following command to configure the cluster quorum to use a file share witness. You're prompted to enter the local credential for the file share witness. Replace
<ClusterName>with the name of your cluster and\\FileShareWitnessServer\WitnessSharewith the path to the file share witness.Set-ClusterQuorum -Cluster <ClusterName> -FileShareWitness \\FileShareWitnessServer\WitnessShare -Credential (Get-Credential) -
To verify the cluster quorum settings, run the following command:
Get-ClusterQuorum -Cluster <ClusterName> | Format-List *
After you configure the cluster quorum, we recommend that you validate the quorum configuration settings by running the Test-Cluster cmdlet.
Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
