Skip to content
SHC Docs

Cluster module

Layer 2. Core. Core The module is the membership record and the voter set.

Source: modules/cluster/ (ce module); the join and enrol implementations live in this repo’s modules/cluster/.

CLINone
Subcommands6
HTTP endpointssee the route reference
Events emittedsee the event reference
Error codessee the error code reference
Service classesClusterNodeService
Cross-module depsapp, doctor, health, network, node, storage
modules/cluster/
├── drain.go
├── errors.go
├── leave.go
├── network.go
├── router.go
├── service.go
├── types.go
├── voters.go
└── commands/

Routes are listed in the generated route reference; request/response notes live in the API reference.

Typed errors are catalogued in the error code reference with HTTP statuses and message templates.

The cluster module owns node membership and the tokens that let new nodes join. node owns the node record.

Service in service.go exposes Init, Join, Leave, Status, and ForceLeader.

Join tokens are issued through /api/method/shc.cluster.token (SHC modules/cluster/token_router.go). The joining node presents its token to /api/join/node.enroll through Traefik on HTTPS 443.

The cluster CA row lives in cluster_ca_store.go. The node plane is mesh0 (see two-tunnel mesh).

The enrol handler lives in SHC modules/cluster/enroll_handler.go, with its public join route registered in enroll_rpc.go.

What the cluster module does not own: per-node daemon wiring (that is node + shc.subsystems.daemon_manager), rqlite (core/db/driver.go), or who is leader (leader). This module is the membership record and the join token.