32.12. Cluster Maintenance and Failure Diagnosis

A cluster is operated, not just built. This section collects the maintenance workflows and the diagnostic habits that the walkthrough's captured evidence supports, and the ones documentation supplies where the lab did not exercise them.

32.12.1. Standby, Maintenance Mode, Planned Switchover, and Failback

Standby is the planned-event tool: the node stays a full cluster member - membership, votes, DRBD replication - but runs no resources. Its transitional state is worth seeing once. On ha1, as john, put the service-holding node on standby:

$ sudo crm node standby ha2
INFO: standby node ha2
$ sudo crm -D plain status
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: ha1 (version 3.0.0-3.0.0) - partition with quorum
  * Last updated: Wed Nov 25 11:44:27 2026 on ha1
  * Last change:  Wed Nov 25 11:44:23 2026 by root via root on ha1
  * 2 nodes configured
  * 6 resource instances configured

Node List:
  * Node ha2: standby (with active resources)
  * Online: [ ha1 ]

Full List of Resources:
  * Clone Set: ms_drbd [p_drbd] (promotable):
    * Promoted: [ ha2 ]
    * Unpromoted: [ ha1 ]
  * Resource Group: g_nfs:
    * p_fs  (ocf:heartbeat:Filesystem):  Started ha2
    * p_vip (ocf:heartbeat:IPaddr2):     Started ha2
    * p_nfs (ocf:heartbeat:nfsserver):   Stopping ha2
    * p_export  (ocf:heartbeat:exportfs):    Stopped

The status was captured mid-transition, and every line of it teaches: ha2 is on standby and unwinding the group in exactly the reverse of the start order - the export is already Stopped and the NFS server Stopping, while the address and filesystem beneath them are still Started - and the DRBD promotion underneath is still ha2's, because the data layer is the last thing to let go. How far the unwinding has progressed when the command runs depends on the moment it is typed within the move's few seconds; the direction never varies. Seconds later the whole group and the promotion had moved to ha1. Return the node:

$ sudo crm node online ha2
INFO: online node ha2

Maintenance mode is the more drastic tool: it disables resource management cluster-wide, so nothing is started, stopped, or recovered while it is on. On ha1, as john:

$ sudo crm maintenance on
$ sudo crm -D plain status
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: ha1 (version 3.0.0-3.0.0) - partition with quorum
  * Last updated: Wed Nov 25 11:44:41 2026 on ha1
  * Last change:  Wed Nov 25 11:44:37 2026 by root via root on ha1
  * 2 nodes configured
  * 6 resource instances configured

              *** Resource management is DISABLED ***
  The cluster will not attempt to start, stop or recover services

Node List:
  * Online: [ ha1 ha2 ]

Full List of Resources:
  * Clone Set: ms_drbd [p_drbd] (promotable, maintenance):
    * p_drbd    (ocf:linbit:drbd):   Promoted ha1 (maintenance)
    * p_drbd    (ocf:linbit:drbd):   Unpromoted ha2 (maintenance)
  * Resource Group: g_nfs (maintenance):
    * p_fs  (ocf:heartbeat:Filesystem):  Started ha1 (maintenance)
    * p_vip (ocf:heartbeat:IPaddr2):     Started ha1 (maintenance)
    * p_nfs (ocf:heartbeat:nfsserver):   Started ha1 (maintenance)
    * p_export  (ocf:heartbeat:exportfs):    Started ha1 (maintenance)

The banner is the point, and so is what did not happen: maintenance disabled management, not the service - the group is still Started ha1, frozen where the completed switchover left it. With management disabled, a dead haproxy or a failed disk produces no recovery, and the cluster is frozen exactly as needed for invasive surgery on a shared component. Leave it as briefly as possible. On ha1, as john:

$ sudo crm maintenance off

The command normally prints nothing, and the next status loses the banner.

Stopping the entire stack on one node is the third tool, and the practice run shows the quorum consequence. On ha2, as john:

$ sudo crm cluster stop
INFO: The cluster stack stopped on ha2

The services moved to ha1 before the stack went down; the survivor serves alone. On ha1, as john:

$ sudo crm -D plain status
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: ha1 (version 3.0.0-3.0.0) - partition with quorum
  * Last updated: Wed Nov 25 11:45:09 2026 on ha1
  * Last change:  Wed Nov 25 11:44:44 2026 by root via root on ha1
  * 2 nodes configured
  * 6 resource instances configured

Node List:
  * Online: [ ha1 ]
  * OFFLINE: [ ha2 ]

Full List of Resources:
  * Clone Set: ms_drbd [p_drbd] (promotable):
    * Promoted: [ ha1 ]
    * Stopped: [ ha2 ]
  * Resource Group: g_nfs:
    * p_fs  (ocf:heartbeat:Filesystem):  Started ha1
    * p_vip (ocf:heartbeat:IPaddr2):     Started ha1
    * p_nfs (ocf:heartbeat:nfsserver):   Started ha1
    * p_export  (ocf:heartbeat:exportfs):    Started ha1

And starting it again. On ha2, as john:

$ sudo crm cluster start
INFO: Starting pacemaker.service on ha2
INFO: The cluster stack started on ha2

WARNING: Qdevice's vote is 0, which simply means Qdevice can't talk to Qnetd(lbclient) for various reasons.

The warning appeared while the freshly started ha2 had not yet re-established its QDevice connection, and it cleared as the connection came up: the next status from ha1 showed both nodes online and quorate. A transient QDevice warning at single-node restart is noise; a persistent Qdevice vote of 0 in corosync-quorumtool -s output is a witness problem worth fixing before the next failure.

32.12.2. Rolling Package and Kernel Updates and Version Compatibility

The rolling-update procedure is the planned switchover, applied cyclically. For each node in turn: switch the service away with the standby procedure, apply updates (the interactive package workflow of Chapter 6), reboot if the kernel changed, verify the node rejoins - Online, clone Unpromoted, DRBD resynchronized and Established - then return it with online and decide deliberately whether to fail back. The rejoin evidence in sections 32.3.5 and 32.12.1 is exactly what to check after each reboot.

Version compatibility is the constraint that makes rolling updates safe:

  • Pacemaker and Corosync: all nodes run the same release; the status header's dc-version and schema version must agree, and mixed major versions refuse to cooperate. Update the idle node first, fail over, update the second, and keep the two updates inside one window.
  • crmsh: keep it current on every node; it speaks to the local Pacemaker and its scripts assume matching versions.
  • DRBD: the kernel module and userspace tools must stay in step, and rolling updates must not mix protocol features across the pair - Chapter 31 pinned the version discipline.
  • Keepalived and HAProxy: identical configurations across the pair, and versions close enough that both directors accept the same configuration syntax.

The lab did not perform package updates on the cluster; the procedure above composes the tested switchover and rejoin operations with the documented compatibility rules.

32.12.3. Diagnosing Resource, Membership, Quorum, and Fencing Failures

Cluster failures read differently from single-host failures because two machines' opinions are involved. The captured misbehavior of this chapter, organized as a diagnostic table:

Symptom First commands Meaning, from the captures
Resources Stopped everywhere, status says WITHOUT quorum sudo corosync-quorumtool -s on each node a partition; the minority correctly stopped itself (section 32.3.5). Count votes, repair the link, rejoin
Activity blocked in quorum output same, plus check the witness: sudo systemctl is-active corosync-qnetd on the witness host a node that lost quorum; its writes are blocked by design, not broken
Cluster will not form at all sudo corosync-cfgtool -s; verify /etc/hosts or DNS; check /var/log/crmsh/crmsh.log knet link down, name resolution failure, or an authkey mismatch - the link tool shows the first, the bootstrap log shows the rest
warning: Blind faith on every change sudo crm configure show \| grep stonith fencing is disabled - a design decision to revisit (section 32.4.4), not an error to silence
A resource restarts repeatedly on one node sudo crm_mon -1 -Af failure counts climbing toward migration-threshold; fix the underlying fault, then crm resource cleanup
Failover did not happen at all check fence device state, sudo journalctl -u pacemaker with fencing enabled, an unconfirmed fence blocks recovery - by design (section 32.4.5)

The full-status viewer adds what crm status omits. On ha1, as john:

$ sudo crm_mon -1 -Af
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: ha1 (version 3.0.0-3.0.0) - partition with quorum
  * Last updated: Wed Nov 25 11:45:25 2026 on ha1
  * Last change:  Wed Nov 25 11:44:44 2026 by root via root on ha1
  * 2 nodes configured
  * 6 resource instances configured

Node List:
  * Online: [ ha1 ha2 ]

Active Resources:
  * Clone Set: ms_drbd [p_drbd] (promotable):
    * Promoted: [ ha1 ]
    * Unpromoted: [ ha2 ]
  * Resource Group: g_nfs:
    * p_fs  (ocf:heartbeat:Filesystem):  Started ha1
    * p_vip (ocf:heartbeat:IPaddr2):     Started ha1
    * p_nfs (ocf:heartbeat:nfsserver):   Started ha1
    * p_export  (ocf:heartbeat:exportfs):    Started ha1

Node Attributes:
  * Node: ha1:
    * master-p_drbd                     : 10000     
  * Node: ha2:
    * master-p_drbd                     : 10000     

Migration Summary:
Option Description
-1 Print one status snapshot and exit, instead of refreshing continuously
-A Include node attributes
-f Include the migration/failure summary

The node attributes are the promotable machinery made visible: the DRBD agent publishes a promotion score per node, and the clone uses those scores to decide where promotion is possible. The Migration Summary is empty in a healthy cluster - that is what healthy looks like, and its non-emptiness is where failure histories appear. In interactive use, plain sudo crm_mon refreshes continuously until stopped with q.

For deeper history, the journals are the source: journalctl -u pacemaker records every transition, fencing decision, and operation timeout; journalctl -u corosync records membership changes; and /var/log/crmsh/crmsh.log records what the administrative tool did. A pacemaker journal line naming a failed operation is the beginning of diagnosis, not the end - the operation's own output follows it in the log. For ongoing external observation rather than incident diagnosis, Chapter 28 covers the monitoring layer that should be watching the service while the cluster watches itself.

32.12.4. Testing Process Failure, Node Loss, and Network Partitions

The chapter has now exercised every failure class it can exercise honestly, and the results are worth one consolidated look:

  • Process failure - the HAProxy backend stops and the pool absorbs it (section 32.8.3); the director's haproxy stops and the tracked process moves the VRRP address (section 32.9.3).
  • Planned node removal - standby, with the transitional state captured (sections 32.6.5, 32.12.1).
  • Stack stop and restart - one node's cluster stack down and back, with the service held by the survivor (section 32.12.1).
  • Communication partition - the minority stops, the majority serves, and the client pays one remount (sections 32.3.5, 32.6.5).
  • Advertisement partition - deliberately created duplicate address ownership, deliberately healed (section 32.9.5).

The class not exercised is actual power loss under fencing, for the practice-lab reason section 32.4.4 states. A deployment's acceptance test adds exactly that case: with a real fence device configured, pull the power on the active node and confirm the sequence of section 32.4.5 - fence succeeds, the survivor promotes, the client verifies. Until that test has passed once, the failover path includes an untested step.

Testing is a practice, not a one-time event. The discipline the walkthrough models - baseline checksum before, independent client during, duplicate count after, cleanup bounded to the practice files - is the reusable part. Schedule failover drills with the same seriousness as fire drills: the value is not confirming that the cluster works, it is discovering that the procedure the humans follow has decayed.

32.12.5. Checking Service Availability and Data Integrity from a Separate Client

Every verification in this chapter shares one rule, stated once more because it is the one administrators break: the cluster's own status is not availability. Started ha2 is the cluster's opinion. Availability is a separate host's experience:

  • the client can connect through the service address (the curl, mount, and smbclient checks);
  • the client's data is intact (the checksum and content comparisons);
  • the client's operations are not duplicated (grep -c counting the post-failover write exactly once);
  • the client's state works (locks, sessions, reconnects - the flock exercise's pattern);
  • and the interruption, when measured, is measured from the client's clock, not the cluster's.

Section 32.6.6 turned these into a five-minute evidence set. Run it after every cluster change, and run it from a host whose only relationship to the cluster is the service address - that independence is what makes the result mean something.

32.12.6. Backing Up Cluster Configuration and Recovering a Lost Node

The cluster's configuration is data like any other, and it deserves the same backup discipline. The practice run saved the whole configuration to the reader's workspace. On ha1, as john:

$ sudo crm configure save /home/john/debian-handbook/ha/cib-backup.txt

The command normally prints nothing. Verify what was written:

$ ls -l /home/john/debian-handbook/ha/cib-backup.txt
-rw-r--r-- 1 root root 1276 Nov 25 11:44 /home/john/debian-handbook/ha/cib-backup.txt
$ head -5 /home/john/debian-handbook/ha/cib-backup.txt
node 1: ha1 \
    attributes standby=off
node 2: ha2 \
    attributes standby=off
primitive p_drbd ocf:linbit:drbd \

The file is the readable form of everything sections 32.5 and 32.6 configured: nodes, primitives, the group, the constraints, the defaults. Copy it off the cluster - a backup that lives only on the cluster it backs up inherits the cluster's failure domains.

The same off-cluster copy should hold the rest of the stack's state: /etc/corosync/ including authkey (root-only permissions preserved), /etc/drbd.d/, /etc/keepalived/, /etc/haproxy/ with its certificate, and the hosts or DNS entries that give the nodes their names. A rebuilt node needs all of them, and the corosync authkey in particular cannot be regenerated - a new key means a new cluster, not a rejoined node.

Recovering a lost node has two cases. A node that was merely stopped or rebooted rejoins on its own once its stack starts - the captured crm cluster start in section 32.12.1, with DRBD resynchronizing automatically. A node that is gone for good is the replacement procedure of section 32.6.7: remove it, build its successor with the same identity and packages, crm cluster join, let DRBD rebuild the copy, and clear any failure history with crm resource cleanup.

Recovering the configuration also has two paths. The verified one is the script that built it: the crm-nfs.txt of section 32.6.3 is itself the backup - deterministic, commented, and loadable with the same crm -F -f command on a rebuilt cluster. The saved text form can be re-applied through crmsh's configure-load facility, documented in crm(8); whichever path is chosen, the recovery belongs in the same tested category as every other procedure in this chapter - rehearse it once on the practice cluster before it is needed on a production one.

That closes the chapter's arc, and most of the book's: the storage chapters built devices, replication, and backups; the network chapters built addresses, routes, and shared services; and this chapter composed them into services that survive the failure of any single host - with the vote arithmetic, fencing, and client-side verification that make survival mean something. Chapter 33 extends the same discipline to storage that is itself a cluster, where the questions of membership, quorum, and fencing are answered inside the storage layer rather than above it.