Skip to main content

Cluster manager

The cluster manager is a vStack OS service on every node; on the node, it is the ccrd daemon. The nodes constantly exchange signals and elect a leader. The leader decides which node serves which pool, fences a failed node and moves its pools to working nodes. The Cluster master role is a set of user permissions, not the cluster manager.

Center passes commands for pools and nodes to the cluster manager. The cluster manager knows nothing about virtual machines (VMs): starting VMs after a pool fails over is Center's job — VM auto-restart after a failure.

Why it works this way​

A ZFS pool cannot be opened on two nodes at once without corrupting data. That is why a single leader makes the "where the pool is open" decision, and the nodes elect this leader by voting. The cluster manager does not depend on Center, so the cluster recovers even when the management VM is unavailable.

Cluster services​

The cluster manager runs services — units that run on exactly one node at any moment:

  • Pool service zpool_<pool> (for example, zpool_z01) — the pool and its floating addresses. Starting the service means opening the pool on a node, bringing up its addresses and starting whatever is bound to the pool.
  • The cluster-management service — the floating address that Center uses to reach the cluster manager. It is always on the leader; you cannot manage it manually.

The management VM is not a service: it moves together with the z01 pool, and the node that opened this pool starts it itself. Center starts the other VMs of the pool.

The leader places a free service on the preferred node if one is set in the configuration, otherwise on the node with the fewest pools. The leader does not move running pools: when a node comes back, pools do not return to it by themselves.

Leader and quorum​

The nodes maintain the leader and the shared cluster state with the Raft algorithm — algorithm description. For which redundancy to choose, see "Even number of nodes" below and the Fencing and quorum page.

  • The leader sends a signal every 200 ms. If there is no signal for 5 ± 1 s, the nodes elect a new leader, and the cluster-management address moves to it.
  • Quorum. A node becomes the leader when at least half of the other nodes, rounded down, vote for it. A leader that loses contact with them steps down. A cluster of 5 nodes keeps a leader while 3 nodes are running; a cluster of 4, while 2 nodes are running.
  • Fencing. A node that does not respond for 4 s is considered failed after another 8 s. The other nodes stop serving their disks to it, and only then does the leader open its pools on other nodes — Fencing and quorum.
  • Retries. The leader retries a failed pool start with a 100 s pause between attempts; after the fifth failure, the service is turned off.

Even number of nodes. On 4 nodes, choose redundancy 1 (N+1); redundancy 2 (N+2) starts from 5 nodes: Fencing and quorum. If the cluster network splits into two equal parts, contact vStack support immediately.

What it decides on its own and what on command​

On its ownOn command from Center or a node utility
elects the leaderstarts, stops and moves a pool
detects a node failure and fences the nodecloses and opens a node
moves the pools of a failed node and their addresses—

Restoring pools and ccrd on a node is the job of vStack support. You can check the state yourself — View the cluster state on a node.

Once a minute, Center checks with the cluster manager which node each pool is open on. The node where the pool is open reports Health and pool usage itself, every two minutes. That is why Current node in the web interface can lag by up to a minute, and Health by up to two minutes.

See also​