目前正在测试中:完成后将开放 GitHub 代码。

配置 (环境变量)

配置仅来自环境变量。名称不区分大小写;空值视为未设置;只有1/true/yes/on为true。范围或组合错误会中止startup。scratch image不使用local disk/PV。

通用设置与resource上限

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

默认profile面向512MiB memory limit。不能超过hard ceiling,也没有unlimited设置。

client认证与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。plaintext cluster必须显式选择private network opt-out,并且不提供机密性或certificate-based node identity。

稳定voter identity

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

cluster identity变量必须一起设置;全部省略为single mode。每次process start都必须由外部签发新incarnation。retired NodeId不再复用;replacement以新NodeId learner加入。client与Raft port均显式指定,不存在+1000规则。

startup admission为fail-closed。初始cluster仅在所有peer证明empty/unconsumed并通过Prepared barrier后Open。replacement仅在one-shot Join批准后Open。Pending/Prepared拒绝Vote、Append、Snapshot和client mutation;绝不把unreachable peer当作empty。

Raft与认证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

clock endpoint必须返回认证reference time、uncertainty、sync state与source age。auth、freshness、RTT、pairwise delta或wall-step检查失败会停止新mutation、drain client并关闭Raft。

cluster认证与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 credential属于不同认证domain,不得复用。Join值只来自prepare-replacement输出;credential为one-shot(默认60秒,允许5–300秒)。peer wire必须exact匹配CLUSTER_WIRE_VERSION=1,不使用package version判断。

See zero-downtime fresh-NodeId learner replacement.