Skip to content

Configuration

Merge order (last wins): built-in defaults → YAML (--config, default clusdr.yaml) → CLUSDR_* environment variables.

clusdr config validate prints the resolved struct.

Only keys that exist in code are listed. Heartbeat and shutdown_timeout are YAML-only.

YAML

yaml
node:
  id: ""                 # set by init; required for a joining node
  addr: "0.0.0.0:7947"   # advertised member address — use a dialable host:port
cluster:
  id: ""                 # set by init
data:
  dir: "~/.clusdr"       # actual default is $HOME/.clusdr
log:
  level: info            # debug | info | warn | error
  format: text           # text | json
grpc:
  addr: "127.0.0.1:7947"
  control_socket: "~/.clusdr/clusdr.sock"  # actual default is $HOME/.clusdr/clusdr.sock
  dial_timeout: 5s
  request_timeout: 10s
shutdown_timeout: 15s    # only applied if > 0; otherwise process default 15s
heartbeat:
  interval: 2s
  timeout: 1s
  max_misses: 3
raft:
  addr: "127.0.0.1:7946"
  bootstrap: false
  heartbeat_timeout: 150ms
  election_timeout: 150ms
  leader_lease_timeout: 75ms
tls:
  mode: enabled          # enabled | disabled
lock:
  ttl: 15s
  expire_interval: 100ms
lease:
  ttl: 15s
  expire_interval: 100ms
  presence: true
  presence_ttl: 3s

leader_lease_timeout must be ≤ heartbeat_timeout. If an override breaks that, load clamps lease to half the heartbeat.

Environment

VariableSets
CLUSDR_NODE_IDnode.id
CLUSDR_NODE_ADDRnode.addr
CLUSDR_CLUSTER_IDcluster.id
CLUSDR_DATA_DIRdata.dir
CLUSDR_LOG_LEVELlog.level
CLUSDR_LOG_FORMATlog.format
CLUSDR_GRPC_ADDRgrpc.addr
CLUSDR_CONTROL_SOCKETgrpc.control_socket
CLUSDR_RAFT_ADDRraft.addr
CLUSDR_RAFT_BOOTSTRAPraft.bootstrap when true or 1
CLUSDR_RAFT_HEARTBEAT_TIMEOUTduration
CLUSDR_RAFT_ELECTION_TIMEOUTduration
CLUSDR_RAFT_LEADER_LEASE_TIMEOUTduration
CLUSDR_TLStls.mode (disabled / off / false / 0 turn TLS off)
CLUSDR_LOCK_TTLduration
CLUSDR_LOCK_EXPIRE_INTERVALduration
CLUSDR_LEASE_TTLduration
CLUSDR_LEASE_EXPIRE_INTERVALduration
CLUSDR_LEASE_PRESENCEbool (true/1/on/enabled, or off)
CLUSDR_LEASE_PRESENCE_TTLduration

CLI --bootstrap injects CLUSDR_RAFT_BOOTSTRAP=true for that process only.

SDK extra: CLUSDR_TLS_SERVER_NAME is read by the Python client only.

Flags --log-level and --log-format override env and YAML for that CLI invocation.

CLUSDR_SHUTDOWN_TIMEOUT is not implemented.

Documentation is sourced from the clusdr/docs tree.