Cluster setup guide

Deploy the full stack: RDMA fabric, Corosync/Pacemaker, OCFS2, Voltron.

End-to-end deployment of a Voltron cluster: the RDMA fabric, the Corosync/Pacemaker stack, a shared OCFS2 filesystem on top of it, and finally the Voltron kernel module + control daemon.

This guide uses a 2-node example; extend the lists for more nodes.

RoleHostnameRDMA/cluster IPNIC
node 1vn110.0.0.1/24ConnectX-3/-4
node 2vn210.0.0.2/24ConnectX-3/-4
Order matters. The layers stack: RDMA + IP → Corosync (membership) → Pacemaker + DLM → OCFS2 → Voltron. Bring them up in that order; tear down in reverse.
Fencing/STONITH: a real shared-disk cluster needs fencing to prevent split-brain corruption. The lab steps below disable it to get going; do not run production OCFS2 without fencing.

10. Prerequisites

On every node:

Debian/Ubuntu:

  sudo apt install corosync pacemaker pcs dlm-controld ocfs2-tools \
                   rdma-core ibverbs-utils iproute2 libcpg-dev

RHEL/Rocky/Alma:

  sudo dnf install corosync pacemaker pcs dlm ocfs2-tools \
                   rdma-core libibverbs-utils iproute corosynclib-devel

InfiniBand-mode fabric only (adds the subnet manager + IPoIB tools):

  sudo apt install opensm infiniband-diags     # RHEL: sudo dnf install opensm infiniband-diags

21. RDMA fabric (ConnectX-3 / ConnectX-4)

rdma_cm always resolves peers by IP, so every node needs an IP on an RDMA-capable interface regardless of the link layer. First decide the link layer per port, then follow the matching sub-section. (CX-3 ports can be either; CX-4 is typically Ethernet.)

# CX-3:  sudo modprobe mlx4_ib      CX-4: sudo modprobe mlx5_ib
rdma link show                      # expect mlx*_0/1 ... state ACTIVE
ibv_devinfo | grep -i link_layer    # Ethernet => RoCE (1a);  InfiniBand => IB (1b)

1a. Ethernet / RoCE v2 ports

Assign the cluster IP directly on the Mellanox netdev; no subnet manager needed.

sudo ip addr add 10.0.0.1/24 dev <mlx-netdev>     # .2 on vn2
sudo ip link set <mlx-netdev> up
ping 10.0.0.2                                      # basic IP reachability

See docs/TESTING.md for the CX-3 Ethernet/RoCE port-type switch.

1b. InfiniBand ports (OpenSM + IPoIB)

A native-IB fabric is dead until a Subnet Manager assigns LIDs and programs the switches. Use a managed switch's built-in SM, or run OpenSM on at least one node (two for redundancy).

sudo apt install opensm            # (RHEL: sudo dnf install opensm)

# bind OpenSM to the HCA port GUID (from `ibstat`); one line per managed port:
sudo sed -i 's/^# guid .*/guid 0x0002c903000xxxxx/' /etc/opensm/opensm.conf 2>/dev/null || true

sudo systemctl enable --now opensm
sudo ibstat                        # Port state must become 'Active' (was 'Initializing')
sudo sminfo                        # shows the acting master SM

For two SMs, set different SMPriority (higher wins master; the other stands by).

IP over InfiniBand (IPoIB) gives rdma_cm the IP addresses it resolves:

sudo modprobe ib_ipoib
ip link show | grep ib             # expect ib0 (and ib1 for the 2nd port)
sudo ip link set ib0 mode datagram # or 'connected' for a larger MTU (cluster-wide, consistent)
sudo ip addr add 10.0.0.1/24 dev ib0     # .2 on vn2
sudo ip link set ib0 up
ping 10.0.0.2
Keep the IPoIB mode (datagram vs connected) and MTU identical on every node. connected mode allows an MTU up to 65520 and usually higher throughput.

Verify GIDs / addressing (both paths)

ibv_devinfo -v | grep -iE 'GID|link_layer|state'   # or: show_gids (rdma-core)
rdma link show                                     # all ports ACTIVE

rdma_cm picks the right GID from the source-IP route automatically. Use the IP you assigned above (<mlx-netdev> for RoCE, ib0 for IB) as the node addr everywhere below.

The same 10.0.0.0/24 subnet carries Corosync, OCFS2/DLM, and Voltron's RDMA data plane.


32. Corosync (membership)

Corosync is the single source of cluster membership — Pacemaker, the DLM, OCFS2, and Voltron all derive from it.

  1. Generate a shared, authenticated key on vn1 and copy it to all nodes: ``sh sudo corosync-keygen # writes /etc/corosync/authkey sudo scp /etc/corosync/authkey vn2:/etc/corosync/authkey sudo chmod 400 /etc/corosync/authkey
  1. /etc/corosync/corosync.conf (identical on all nodes): `` totem { version: 2 cluster_name: voltron transport: knet crypto_cipher: aes256 crypto_hash: sha256 } nodelist { node { ring0_addr: 10.0.0.1 name: vn1 nodeid: 1 } node { ring0_addr: 10.0.0.2 name: vn2 nodeid: 2 } } quorum { provider: corosync_votequorum two_node: 1 # lab: allow quorum with 2 nodes } logging { to_syslog: yes } ` > Use the **Corosync nodeid** as the Voltron local_id` later, so the two > membership views agree.
  1. Start and verify: ``sh sudo systemctl enable --now corosync sudo corosync-cfgtool -s # ring state sudo corosync-quorumtool -l # both nodes present + quorate

43. Pacemaker + DLM

OCFS2's "pcmk" stack means the kernel DLM (fs/dlm) driven by dlm_controld, managed as a Pacemaker clone so it starts on every node.

sudo systemctl enable --now pacemaker

Lab cluster properties (disable STONITH for testing only):

sudo pcs property set stonith-enabled=false
sudo pcs property set no-quorum-policy=freeze     # safe for shared storage

Create the DLM clone (runs dlm_controld cluster-wide):

sudo pcs resource create dlm ocf:pacemaker:controld \
     op monitor interval=30s on-fail=fence \
     clone interleave=true ordered=true
sudo pcs status                 # dlm clone Started on vn1 and vn2
In production replace stonith-enabled=false with a real fence device (fence_ipmilan, fence_scsi, etc.) and keep on-fail=fence.

54. OCFS2 filesystem

Create the filesystem with the pacemaker cluster stack stamped into it. Do this once, from a single node, on the shared device:

sudo mkfs.ocfs2 \
     --cluster-stack=pcmk \
     --cluster-name=voltron \
     -N 8 \
     --fs-feature-level=max-features \
     -L voltron-shared \
     /dev/sdb

Mount it as a Pacemaker clone so it mounts everywhere and is ordered after DLM:

sudo pcs resource create voltronfs ocf:heartbeat:Filesystem \
     device="/dev/sdb" directory="/srv/shared" fstype="ocfs2" \
     op monitor interval=20s \
     clone interleave=true

# DLM must start before the FS, everywhere:
sudo pcs constraint order start dlm-clone then voltronfs-clone
sudo pcs constraint colocation add voltronfs-clone with dlm-clone
sudo pcs status

Verify on both nodes:

mount | grep ocfs2                 # /dev/sdb on /srv/shared type ocfs2
echo hi | sudo tee /srv/shared/test-from-$(hostname)
ls -l /srv/shared                  # each node sees the others' files
Manual alternative (no Pacemaker FS resource): with dlm_controld running you can sudo mount -t ocfs2 /dev/sdb /srv/shared directly; the kernel uses the pcmk stack recorded in the superblock. The clone is preferred for auto-mount and ordering.

65. Voltron kernel module

On every node, build against the booted kernel and load:

cd src && make KDIR=/lib/modules/$(uname -r)/build
sudo insmod voltron.ko
ls /sys/kernel/voltron/            # cluster/ policy/ version default_mode

(Optionally install to /lib/modules/$(uname -r)/extra/ + depmod for modprobe/auto-load.)


76. voltron-ctld (control daemon)

The daemon ties Corosync membership + the OCFS2 admission check to the kernel node table. Build with the Corosync provider (requires libcpg-dev, installed above):

cd userspace/voltron-ctld && make          # auto-enables corosync if libcpg present

/etc/voltron-ctld.conf on vn1 (mirror on vn2 with its own local_id):

local_id   1                      # == Corosync nodeid
sysfs_root /sys/kernel/voltron
fs_mount   /srv/shared            # the OCFS2 mountpoint from step 4
provider   corosync               # learn membership from the CPG

Run as a service on each node:

sudo ./voltron-ctld -c /etc/voltron-ctld.conf

On start it will:

  1. verify /srv/shared is OCFS2 and writable (admission check); if not, this node is marked not migration-eligible,
  2. write local_node_id,
  3. join the Corosync CPG and reconcile live peers into /sys/kernel/voltron/cluster/nodes/.

Verify the node table built itself up:

ls /sys/kernel/voltron/cluster/nodes/           # peer ids appear
cat /sys/kernel/voltron/cluster/nodes/2/state   # up
cat /sys/kernel/voltron/cluster/nodes/2/fs_eligible
The Corosync provider is currently a stub; until it lands, use provider static with an explicit peer list (see docs/USAGE.md §4) — the rest of the setup is identical.

87. Bring up the RDMA data plane

Start the listener on all nodes and connect peers (this becomes automatic once migration is wired; for now it is explicit / driven by ctld):

echo 18515 | sudo tee /sys/kernel/voltron/cluster/rdma_listen     # every node
echo 18515 | sudo tee /sys/kernel/voltron/cluster/nodes/2/connect # vn1 -> vn2
dmesg | tail        # "node 2: connection established"

98. Define migration policy

Opt specific cgroups in (everything is deny by default). Example: pin a batch slice to node 2.

sudo mkdir -p /sys/fs/cgroup/batch.slice
CGID=$(stat -c %i /sys/fs/cgroup/batch.slice)
echo "$CGID" | sudo tee /sys/kernel/voltron/policy/add_cgroup
echo manual   | sudo tee /sys/kernel/voltron/policy/cgroups/$CGID/mode
echo 2        | sudo tee /sys/kernel/voltron/policy/cgroups/$CGID/target

See docs/USAGE.md §5 for auto/PSI policy and inheritance.


109. Verify the whole stack

sudo corosync-quorumtool -l                 # membership quorate
sudo pcs status                             # dlm + voltronfs clones Started
mount | grep ocfs2                          # OCFS2 mounted on all nodes
ls /sys/kernel/voltron/cluster/nodes/       # Voltron sees peers
dmesg | grep voltron                        # RDMA connects, no errors

1110. Adding / removing a node

Add vn3 (nodeid 3):

  1. Hardware/RDMA/IP per step 1; /etc/hosts updated everywhere.
  2. Add it to corosync.conf nodelist on all nodes; corosync-cfgtool -R to reload (or rolling restart).
  3. Ensure enough OCFS2 node slots (tunefs.ocfs2 -N <bigger> if needed).
  4. Start pacemaker on vn3 → dlm + voltronfs clones extend to it.
  5. Install + load voltron.ko, start voltron-ctld (local_id 3). The new node appears in every node's cluster/nodes/.

Remove a node:

  1. Stop voltron-ctld and rmmod voltron on it (peers drop it from the table).
  2. pcs cluster stop on it; remove from corosync.conf nodelist; reload.

1211. Teardown (reverse order)

sudo rmmod voltron                 # all nodes
sudo pcs resource disable voltronfs-clone     # unmount OCFS2
sudo pcs resource disable dlm-clone
sudo systemctl stop pacemaker corosync

13Troubleshooting

SymptomLikely cause / fix
OCFS2 mount hangs or cluster stack errordlm_controld not running / stack mismatch. Confirm pcs status shows dlm Started and the FS was made with --cluster-stack=pcmk --cluster-name=voltron.
Transport endpoint is not connected on FSlost Corosync membership/quorum; check corosync-quorumtool.
Voltron nodes/ stays emptyctld not joining CPG, or provider static with no peers; check ctld logs.
fs_eligible = 0OCFS2 not mounted/writable at fs_mount on that node.
RDMA connect times outno ACTIVE rdma link, wrong IP/subnet, or RoCE CM port blocked (UDP 4791).
IB port stuck Initializing (never Active)no Subnet Manager on the fabric — start OpenSM (step 1b) or enable the switch SM; check sminfo.
ib0 interface missingib_ipoib not loaded, or the port is in Ethernet mode (then use the RoCE path 1a).
Node fenced/rebooted unexpectedlyfencing misconfig; in a lab set stonith-enabled=false (not for production).

See also docs/USAGE.md (operation), docs/TESTING.md (RDMA bring-up), docs/CLUSTER.md (why membership is aligned with the OCFS2 stack).