Derzeit im Test: Der GitHub-Code wird nach Abschluss veröffentlicht.

Konfiguration (Umgebungsvariablen)

Die Konfiguration kommt ausschließlich aus Umgebungsvariablen. Namen sind case-insensitive, leer gilt als nicht gesetzt, und nur 1/true/yes/on ist true. Ungültige Bereiche/Kombinationen brechen den Start ab. Das Scratch-Image nutzt keine lokale Platte oder PV.

Gemeinsame Einstellungen und Ressourcengrenzen

VariableDefaultAllowedPurpose
SERVER_PORT5225valid u16 portsingle client port; cluster advertises CLUSTER_SELF
SOCKET_BIND0.0.0.0bindable addressclient and Raft bind host
DEBUG_MODEbuild settingflagdebug logging
DOCKER_MODEfalseflagofficial image binds internal 5225/6225
MAX_CONNECTIONS10241..8192concurrent client connections
MAX_RAFT_CONNECTIONS641..256separate Raft/control reserve
MAX_WAITERS20481..16384waiters per key; excess acquire gets B
MAX_TOTAL_WAITERS16384MAX_WAITERS..65536total waiters; excess acquire gets B
Hard capValueSaturation behavior
in-flight acquire per connection64B for that acquire
global in-flight acquire4096B for that acquire
global in-flight release512 separate lanebounded wait until connection close
queued replies per connection256close slow client
coordinator channel4096backpressure
cluster active keys65536B for new-key acquire
Raft frame64MiBreject RPC
encoded snapshot64MiB - 64KiBreject build/install
concurrent Raft decode budget72MiBbounded permit wait/timeout

Das Standardprofil zielt auf 512MiB Memory Limit. Hard Ceilings sind nicht überschreitbar; nichts ist unlimited.

Client-Authentifizierung und TLS

VariableDefaultPurpose
CLIENT_TOKENSone empty tokencomma-separated client credentials; production should use nonblank secrets
TLS_CERT / TLS_KEYunsetserver certificate chain/private key; set together
TLS_CAsystem rootsCA for peer certificate verification
TLS_SKIP_VERIFYfalsetest only
CLUSTER_ALLOW_PLAINTEXT_PRIVATEfalseexplicit opt-out for isolated private networks

TLS wird empfohlen. Plaintext-Cluster brauchen expliziten Private-Network-Opt-out und bieten weder Vertraulichkeit noch zertifikatsbasierte Node-Identität.

Stabile Voter-Identität

VariableConstraintPurpose
CLUSTER_ID1–128 ASCII alnum/./_/-fencing domain
CLUSTER_NODE_IDu64Raft ID; never reuse after retirement
CLUSTER_INCARNATIONnon-zero u128freshly issued per process start
CLUSTER_SELFhost:client-portstable client slot and redirect address
CLUSTER_RAFT_SELFhost:raft-portunique Raft/control address for this process
CLUSTER_PEERSexactly 3 or 5NodeId@incarnation@client-address@raft-address entries

Alle Cluster-Identity-Variablen sind gemeinsam Pflicht; alle weggelassen bedeutet Single Mode. Jeder Prozessstart braucht eine frisch extern ausgegebene Incarnation. Retired NodeIds werden nie wiederverwendet; Ersatz tritt als Learner mit neuer NodeId bei. Client- und Raft-Port sind explizit, ohne +1000-Regel.

Startup Admission arbeitet fail-closed. Ein initialer Cluster öffnet erst, wenn jeder Peer empty/unconsumed beweist und die Prepared Barrier passiert. Ersatz öffnet nur nach One-shot-Join. Pending/Prepared lehnen Vote, Append, Snapshot und Client Mutation ab. Unerreichbare Peers gelten nie als leer.

Raft und authentifizierte Clock

VariableDefaultConstraint
CLUSTER_HEARTBEAT_MS500>=10
CLUSTER_ELECTION_TIMEOUT_MS2000>=600, >=4× heartbeat
CLUSTER_SNAPSHOT_TIMEOUT_MS120000>=1000
RAFT_PROGRESS_TIMEOUT_MS10000>=1000
CLUSTER_CLOCK_AGENT_ENDPOINTunsetrequired numeric IP:port in cluster
CLUSTER_CLOCK_AGENT_SECRETunsetrequired, at least 32 bytes, separate domain
CLUSTER_CLOCK_PAIRWISE_DELTA_MS202..=60000, identical on all nodes
CLUSTER_CLOCK_MAX_STALENESS_MS5000greater than sample interval + timeout
CLUSTER_CLOCK_SAMPLE_INTERVAL_MS1000positive and below staleness
CLUSTER_CLOCK_TIMEOUT_MS250positive and below staleness
CLUSTER_CLOCK_MAX_RTT_MS50positive and at most timeout
CLUSTER_CLOCK_MAX_UNCERTAINTY_MS2at most pairwise delta / 2
CLUSTER_CLOCK_MAX_SOURCE_AGE_MS2000positive

Der Clock Endpoint liefert authentifizierte Reference Time, Uncertainty, Sync State und Source Age. Fehler bei Auth/Freshness/RTT/Pairwise Delta/Wall Step stoppen Mutations, drainen Clients und fahren Raft herunter.

Cluster-Authentifizierung und Replacement Join

VariableRequirement
CLUSTER_TOKENSnonblank list required in cluster
CLUSTER_CONTROL_TOKENSnonblank list required in cluster
CLUSTER_BOOTSTRAP_CREDENTIALinitial cluster process only; recorded once in replicated state

Replacement process values generated by prepare-replacement:

  • CLUSTER_JOIN_LEADER
  • CLUSTER_JOIN_LEADER_NODE_ID
  • CLUSTER_JOIN_LEADER_INCARNATION
  • CLUSTER_JOIN_CREDENTIAL
  • CLUSTER_JOIN_SEED_PEERS
  • fresh CLUSTER_NODE_ID, CLUSTER_INCARNATION, CLUSTER_SELF, CLUSTER_RAFT_SELF, CLUSTER_PEERS

Cluster/Control/Clock/Bootstrap/Join Credentials sind getrennte Domains ohne Wiederverwendung. Join-Werte stammen nur aus prepare-replacement; One-shot Credential, Standard 60s, erlaubt 5–300s. Peer Wire verlangt exakt CLUSTER_WIRE_VERSION=1; Package Version zählt nicht.

See zero-downtime fresh-NodeId learner replacement.