32.1. Choosing a High-Availability Design

A high-availability design is a set of choices about who may write, how fast ownership moves, and what a failover is allowed to interrupt. Those choices determine the software you install, the networks you build, and the tests you owe the service before declaring it highly available.

32.1.1. Active-Passive Failover, Active-Active Services, and Load Balancing

An active-passive service runs on exactly one host at a time. The second host holds a ready copy of the data, joins the cluster, and does nothing visible for clients until it is needed. Ownership is a single fact - one promoted DRBD role, one mounted filesystem, one listening service, one virtual address - and every component of the service must agree on which host holds it. The active-passive NFS walkthrough in section 32.6 is the canonical example: ha2 is a full cluster member with an up-to-date DRBD copy, but it serves no client until the group moves.

An active-active service runs the same software on several hosts concurrently. This is only safe when the software is designed for it: a cluster-aware filesystem arbitrates its own locks, a clustered database layer arbitrates transactions, or the instances share nothing writable at all. Two nginx workers serving static content from identical local copies are active-active; two nfsserver instances on the same ext4 filesystem are not. Active-active raises throughput and removes the failover step for single-node loss, but it raises the design cost: membership, locking, and fencing must all be correct while everyone is running, not just at the moment of transfer.

Load balancing is a third pattern, and it composes with either of the first two. A proxy or a kernel forwarder spreads client requests across several backend instances and withdraws traffic from unhealthy ones. The balancer itself becomes the new single point of failure, so it is normally duplicated behind a floating address - which is an active-passive pair of load balancers. The final exercises in this chapter build exactly that arrangement with Keepalived, HAProxy, and LVS.

Design Writes at one time Spare capacity Added requirements Typical use
Active-passive one host idle during normal operation ordered promotion, fencing, one identity to move stateful file service, primary database
Active-active every host, coordinated used by clients cluster-aware software, shared or replicated data, consistent identity clustered SMB with CTDB, sharded application tiers
Load-balanced tier each backend its own share used by clients health checks, session handling, redundant balancer web and application frontends

The patterns stack. A load-balanced tier of stateless web frontends commonly talks to an active-passive database, fronted in turn by redundant load balancers. The important rule is that each moving part is owned by exactly one manager - a point section 32.9.6 develops when two virtual-address managers meet.

32.1.2. Availability Targets, Recovery Time, and Application Consistency

Availability is usually expressed as a percentage of intended uptime. The fractions are arithmetic, not aspiration: the implied budget of downtime per year is what the design must actually deliver.

Availability Allowed downtime per year What it usually implies
99% about 3.7 days ordinary single host with fast repair
99.9% about 8.8 hours redundant hardware, automated restart, planned maintenance windows
99.99% about 53 minutes automatic failover, validated procedures, monitored spares
99.999% about 5.3 minutes no single failure domain, rehearsed failover, strict change control

Two quantities connect the design to real incidents. The recovery time objective (RTO) is how long the service may be unavailable; the active-passive NFS walkthrough moves the group in about sixteen seconds, and section 32.6.5 states exactly what that measurement covers. The recovery point objective (RPO) is how much acknowledged work may be lost. A synchronous replication design targets an RPO of zero: no write is acknowledged until both copies hold it. An asynchronous design accepts a nonzero RPO in exchange for latency, and a failover then has to choose between losing recent writes and refusing service - a choice that must be made by design, not improvised at 3 a.m.

Consistency is the third axis, and it is the one clusters most often get wrong. An acknowledged write must be present after failover. That sounds simple, but it excludes several tempting shortcuts: failing over to a replica that lagged behind, moving a filesystem while the old owner can still write, or accepting two owners because both looked healthy. Every subsequent procedure in this chapter exists to make the acknowledged-writes guarantee survive the failover.

32.1.3. Shared Storage, Replicated Storage, and Application-Native Replication

A failover needs data on the new owner. There are three fundamentally different ways to arrange that, and they differ in what moves, who may write, and what defends against two writers.

Strategy Data location Writing model Split-brain defense Fits Covered in
Shared block storage (SAN LUN, iSCSI) one array, visible to all nodes exactly one node mounts; others are cold cluster fencing plus quorum large datasets, fast resync-free takeover Chapter 33
Replicated block storage (DRBD) a copy on each node one primary; peers block writes DRBD's primary rule plus cluster quorum and fencing two-node pairs without a SAN Chapter 31, this chapter
Application-native replication (PostgreSQL streaming, Ceph) inside the application's own storage layer application elects and fences the writer application quorum and lease mechanisms databases, distributed storage Chapter 34, Chapter 33

Shared storage makes the failover fast - nothing resynchronizes - but the array itself becomes a shared failure domain, and an ordinary filesystem such as ext4 may only be mounted by one node at a time, so the cluster still owns the mount. Replicated storage keeps each node's copy independent, costs write latency for the synchronous copy, and needs the same cluster discipline. Application-native replication delegates the hard problems to software built for them, which is the right answer for databases and the wrong one for a generic filesystem.

The NFS walkthrough uses DRBD because it needs no extra hardware, because Chapter 31 already built and tested the resource, and because its single-primary rule composes cleanly with Pacemaker's promotable resources. The choice also shows the general shape of the problem: the cluster manager promotes the storage, mounts the filesystem, starts the service, and only then advertises the address.

32.1.4. Node, Network, Power, and Storage Failure Domains

A failure domain is the set of components that fail together. Redundancy only helps when the redundant copies live in different domains; two nodes on one power feed, one switch, or one storage controller have not removed that feed, switch, or controller as a single point of failure. A design review names the domains explicitly:

  • Node domain: the whole machine - kernel, RAM, its NICs, its disks. Two nodes in one chassis are one domain.
  • Network domain: a NIC, a cable, a switch, a VLAN. The practice lab uses two independent networks so a rule on the cluster network cannot cut the service network or the management path.
  • Power domain: a feed, a PDU, a UPS. Nodes should draw power from different feeds; the witness should not share a feed with either node.
  • Storage domain: a controller, a LUN, an array shelf. DRBD's copies are in separate node domains by construction; a shared LUN's two consumers are in one array domain no matter how many nodes mount it.
  • Management domain: the SSH path, the hypervisor, the out-of-band network. The witness in this chapter runs on a different host from either node for exactly this reason.

The practice topology honors the separations that cost nothing: two networks, separate client and witness hosts, and the management network untouched by every exercise. It also knowingly violates one: all five guests share a single hypervisor, so the "node loss" exercises demonstrate the cluster's decisions, not a physical failure. A production deployment applies the same review and spends money on the domains the business actually fears.