Chapter 28. Configuring quorum devices
You can allow a cluster to sustain more node failures than standard quorum rules allows by configuring a separate quorum device which acts as a third-party arbitration device for the cluster. A quorum device is recommended for clusters with an even number of nodes. With two-node clusters, the use of a quorum device can better determine which node survives in a split-brain situation.
You must take the following into account when configuring a quorum device.
- It is recommended that a quorum device be run on a different physical network at the same site as the cluster that uses the quorum device. Ideally, the quorum device host should be in a separate rack than the main cluster, or at least on a separate PSU and not on the same network segment as the corosync ring or rings.
- You cannot use more than one quorum device in a cluster at the same time.
-
Although you cannot use more than one quorum device in a cluster at the same time, a single quorum device may be used by several clusters at the same time. Each cluster using that quorum device can use different algorithms and quorum options, as those are stored on the cluster nodes themselves. For example, a single quorum device can be used by one cluster with an
ffsplit(fifty/fifty split) algorithm and by a second cluster with anlms(last man standing) algorithm. - A quorum device should not be run on an existing cluster node.
28.1. Installing quorum device packages Copy linkLink copied to clipboard!
Configuring a quorum device for a cluster requires that you install the following packages:
Install
corosync-qdeviceon the nodes of an existing cluster.[root@node1:~]# yum install corosync-qdevice [root@node2:~]# yum install corosync-qdevice
[root@node1:~]# yum install corosync-qdevice [root@node2:~]# yum install corosync-qdeviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install
pcsandcorosync-qnetdon the quorum device host.[root@qdevice:~]# yum install pcs corosync-qnetd
[root@qdevice:~]# yum install pcs corosync-qnetdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the
pcsdservice and enablepcsdat system start on the quorum device host.[root@qdevice:~]# systemctl start pcsd.service [root@qdevice:~]# systemctl enable pcsd.service
[root@qdevice:~]# systemctl start pcsd.service [root@qdevice:~]# systemctl enable pcsd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
28.2. Configuring a quorum device Copy linkLink copied to clipboard!
Configure a quorum device and add it to the cluster with the following procedure.
In this example:
-
The node used for a quorum device is
qdevice. The quorum device model is
net, which is currently the only supported model. Thenetmodel supports the following algorithms:-
ffsplit: fifty-fifty split. This provides exactly one vote to the partition with the highest number of active nodes. lms: last-man-standing. If the node is the only one left in the cluster that can see theqnetdserver, then it returns a vote.WarningThe LMS algorithm allows the cluster to remain quorate even with only one remaining node, but it also means that the voting power of the quorum device is great since it is the same as number_of_nodes - 1. Losing connection with the quorum device means losing number_of_nodes - 1 votes, which means that only a cluster with all nodes active can remain quorate (by overvoting the quorum device); any other cluster becomes inquorate.
For more detailed information about the implementation of these algorithms, see the
corosync-qdevice(8) man page.
-
-
The cluster nodes are
node1andnode2.
Procedure
On the node that you will use to host your quorum device, configure the quorum device with the following command. This command configures and starts the quorum device model
netand configures the device to start on boot.[root@qdevice:~]# pcs qdevice setup model net --enable --start Quorum device 'net' initialized quorum device enabled Starting quorum device... quorum device started
[root@qdevice:~]# pcs qdevice setup model net --enable --start Quorum device 'net' initialized quorum device enabled Starting quorum device... quorum device startedCopy to Clipboard Copied! Toggle word wrap Toggle overflow After configuring the quorum device, you can check its status. This should show that the
corosync-qnetddaemon is running and, at this point, there are no clients connected to it. The--fullcommand option provides detailed output.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the ports on the firewall needed by the
pcsddaemon and thenetquorum device by enabling thehigh-availabilityservice onfirewalldwith following commands.[root@qdevice:~]# firewall-cmd --permanent --add-service=high-availability [root@qdevice:~]# firewall-cmd --add-service=high-availability
[root@qdevice:~]# firewall-cmd --permanent --add-service=high-availability [root@qdevice:~]# firewall-cmd --add-service=high-availabilityCopy to Clipboard Copied! Toggle word wrap Toggle overflow From one of the nodes in the existing cluster, authenticate user
haclusteron the node that is hosting the quorum device. This allowspcson the cluster to connect topcson theqdevicehost, but does not allowpcson theqdevicehost to connect topcson the cluster.[root@node1:~] # pcs host auth qdevice Username: hacluster Password: qdevice: Authorized
[root@node1:~] # pcs host auth qdevice Username: hacluster Password: qdevice: AuthorizedCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the quorum device to the cluster.
Before adding the quorum device, you can check the current configuration and status for the quorum device for later comparison. The output for these commands indicates that the cluster is not yet using a quorum device, and the
Qdevicemembership status for each node isNR(Not Registered).[root@node1:~]# pcs quorum config Options:
[root@node1:~]# pcs quorum config Options:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following command adds the quorum device that you have previously created to the cluster. You cannot use more than one quorum device in a cluster at the same time. However, one quorum device can be used by several clusters at the same time. This example command configures the quorum device to use the
ffsplitalgorithm. For information about the configuration options for the quorum device, see thecorosync-qdevice(8) man page.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the configuration status of the quorum device.
From the cluster side, you can execute the following commands to see how the configuration has changed.
The
pcs quorum configshows the quorum device that has been configured.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
pcs quorum statuscommand shows the quorum runtime status, indicating that the quorum device is in use. The meanings of of theQdevicemembership information status values for each cluster node are as follows:-
A/NA- The quorum device is alive or not alive, indicating whether there is a heartbeat betweenqdeviceandcorosync. This should always indicate that the quorum device is alive. -
V/NV-Vis set when the quorum device has given a vote to a node. In this example, both nodes are set toVsince they can communicate with each other. If the cluster were to split into two single-node clusters, one of the nodes would be set toVand the other node would be set toNV. MW/NMW- The internal quorum device flag is set (MW) or not set (NMW). By default the flag is not set and the value isNMW.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
pcs quorum device statusshows the quorum device runtime status.Copy to Clipboard Copied! Toggle word wrap Toggle overflow From the quorum device side, you can execute the following status command, which shows the status of the
corosync-qnetddaemon.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
28.3. Managing the quorum device service Copy linkLink copied to clipboard!
PCS provides the ability to manage the quorum device service on the local host (corosync-qnetd), as shown in the following example commands. Note that these commands affect only the corosync-qnetd service.
[root@qdevice:~]# pcs qdevice start net [root@qdevice:~]# pcs qdevice stop net [root@qdevice:~]# pcs qdevice enable net [root@qdevice:~]# pcs qdevice disable net [root@qdevice:~]# pcs qdevice kill net
[root@qdevice:~]# pcs qdevice start net
[root@qdevice:~]# pcs qdevice stop net
[root@qdevice:~]# pcs qdevice enable net
[root@qdevice:~]# pcs qdevice disable net
[root@qdevice:~]# pcs qdevice kill net
28.4. Managing a quorum device in a cluster Copy linkLink copied to clipboard!
There are a variety of pcs commands that you can use to change the quorum device settings in a cluster, disable a quorum device, and remove a quorum device.
28.4.1. Changing quorum device settings Copy linkLink copied to clipboard!
You can change the setting of a quorum device with the pcs quorum device update command.
To change the host option of quorum device model net, use the pcs quorum device remove and the pcs quorum device add commands to set up the configuration properly, unless the old and the new host are the same machine.
The following command changes the quorum device algorithm to lms.
28.4.2. Removing a quorum device Copy linkLink copied to clipboard!
The following command removes a quorum device configured on a cluster node.
After you have removed a quorum device, you should see the following error message when displaying the quorum device status.
[root@node1:~]# pcs quorum device status Error: Unable to get quorum status: corosync-qdevice-tool: Can't connect to QDevice socket (is QDevice running?): No such file or directory
[root@node1:~]# pcs quorum device status
Error: Unable to get quorum status: corosync-qdevice-tool: Can't connect to QDevice socket (is QDevice running?): No such file or directory
28.4.3. Destroying a quorum device Copy linkLink copied to clipboard!
The following command disables and stops a quorum device on the quorum device host and deletes all of its configuration files.
[root@qdevice:~]# pcs qdevice destroy net Stopping quorum device... quorum device stopped quorum device disabled Quorum device 'net' configuration files removed
[root@qdevice:~]# pcs qdevice destroy net
Stopping quorum device...
quorum device stopped
quorum device disabled
Quorum device 'net' configuration files removed