Skip to content

Architecture

This page is the technical overview. Subsystems have their own concept pages.

Process model

The daemon (clusdr start) is the cluster member. It speaks Hashicorp Raft to peers and gRPC to the local host.

The application is not a Raft member. It uses the SDK against the daemon on the same machine (Docker-style). Two apps on one host share one daemon.

text
app A ─┐
app B ─┼─► daemon on this host ─► other daemons (Raft + gRPC)
cli   ─┘

Operators use the same binary: clusdr is daemon and CLI.

Two listeners

ListenerDefaultWho uses it
Runtime API (TCP)127.0.0.1:7947Apps, most CLI commands, peer join / events / heartbeats
Control API (Unix)$HOME/.clusdr/clusdr.sockclusdr status only checks that this file exists

CLI commands other than status dial the Runtime API, not the socket.

What is replicated

Raft log (strong consistency, leader is the only writer):

  • Membership and leadership
  • Locks and leases (including presence)

Not on the Raft log:

  • Application data
  • Custom event payloads (events are 1-hop gossip)

Data on disk

Under data.dir (default $HOME/.clusdr, or /var/lib/clusdr if HOME is unset):

PathContents
state.dbBoltDB identity, token hash, cert material
raft/Raft log and snapshots
ca.crt, node.crt, node.keyCluster CA and this node's cert

Two processes must not share one data.dir (BoltDB flock).

Addresses that must be reachable

Port / pathDefaultMust be reachable by
Runtime gRPC127.0.0.1:7947Local apps; peers if you advertise it
Raft127.0.0.1:7946Every Raft peer
Control socket$HOME/.clusdr/clusdr.sockLocal status only

node.addr is what membership stores for this node. If it is 0.0.0.0:7947, peers cannot dial you. Set a host:port they can use.

The seed node's self-membership is written with grpc.addr when it becomes leader.

Size

Quorum is majority. Three voters tolerate one failure. Prefer odd voter counts.

Observers receive the log but do not vote.

Next

Documentation is sourced from the clusdr/docs tree.