Every entry in ticketing.toml (optional) can also be set via an environment variable. Precedence is environment variable > ticketing.toml > default, and both keys and boolean values are case-insensitive. The Docker image is scratch-based, so injecting config via environment variables is the default (to use a config file instead, mount it and point CONFIG at its path).
| Environment variable | Default | Description |
|---|---|---|
PORT (SERVER_PORT) | 5225 | TCP listen port. Ignored in cluster mode, where the port from CLUSTER_SELF is used instead |
DEBUG (SERVER_DEBUG) | Depends on build | 1/true enables debug logging |
SOCKET_BIND | 0.0.0.0 | Listen address |
SOCKET_NODELAY | true | TCP_NODELAY |
SOCKET_READ_BUF_LEN | 4096 | Read buffer per connection (bytes) |
SOCKET_REPLY_QUEUE | 1024 | Reply queue length per connection |
SOCKET_REPLY_BATCH | 64 | Max number of replies batched into a single write |
SWEEP_INTERVAL_SECS | 5 | Expired-key sweep interval (seconds) |
CLUSTER_SELF | (none) | This node's advertised address, host:port. Presence enables cluster mode |
CLUSTER_PEERS | (none) | Comma-separated list of node addresses. Order = promotion priority, must include self, 2 or more entries |
CONFIG | ./conf/ticketing.toml | Config file path |
[cluster] (or CLUSTER_*), the node runs standalone. Fastest, but there's a brief blip on restart, and state is in-memory so it's lost on restart (lease is the safety net).CLUSTER_PEERS (in priority order) and its own CLUSTER_SELF pointing to itself. Among the live nodes, the one with the highest priority becomes active, and the rest become standbys receiving real-time replication. For details, see How It Works and Protocol — Server ↔ Server.Kubernetes cluster deployments use a StatefulSet + headless Service. Give each pod a stable DNS name (
ticketing-0.ticketing…,ticketing-1.ticketing…), put those names intoCLUSTER_PEERSin priority order, and auto-inject each pod'sCLUSTER_SELFvia the downward API (metadata.name).
Ctrl+C) — a handoff promotes a standby and clients move over.sarolab/ticketing · Github: saro-lab/ticketing