menuTicketing

Configuration Rules

  • peers must include self, and must list at least 2 nodes (otherwise it panics at boot).
  • The listen address is socket.bind (default 0.0.0.0); the advertised address is self. Behind a firewall/NAT, self should be the address other nodes can actually reach.
  • The port is taken from self. In cluster mode, the PORT environment variable is ignored, and the port from self becomes the listen port.
  • The order of peers is the promotion priority (the first entry has the highest priority).
toml
# ticketing.toml on 10.0.0.1
[cluster]
self  = "10.0.0.1:5225"
peers = ["10.0.0.1:5225", "10.0.0.2:5225"]
toml
# ticketing.toml on 10.0.0.2 — peers is identical, only self differs
[cluster]
self  = "10.0.0.2:5225"
peers = ["10.0.0.1:5225", "10.0.0.2:5225"]

Clients (brokers) register both addresses so they can fail over automatically:

rust
TicketBroker::connect(&["10.0.0.1:5225", "10.0.0.2:5225"]);

For generating actual deployment commands, see the Ticketing Server Deployment page.