ARCANUM
self-host

Run Rune

One image for a single node or a cluster. Configuration is environment variables. Authentication is on: every node needs the cluster key.

Single node

Run with --network host: same latency as bare metal, while the Docker bridge adds about 35 µs at p50 and published ports make p99 about 10× worse. Linux only in practice; Docker Desktop goes through its VM (add -e RUNE_IO_BACKEND=portable there, and on Rosetta). Three one-time steps: a cluster key, a formatted data volume, a first admin.

rune security gen-cluster-key --out secrets/cluster.key # one key per cluster, mode 0600 docker run --rm -v rune-data:/var/lib/rune -e RUNE_DATA_DIR=/var/lib/rune \ arcanumruna/rune rune_broker storage format --new # an empty volume is never formatted for you
docker run -d --network host --shm-size=256m \ -v "$PWD/secrets/cluster.key:/run/secrets/cluster.key:ro" \ -e RUNE_CLUSTER_KEY_FILE=/run/secrets/cluster.key \ -e RUNE_NODE_ID=0 \ -e RUNE_PEERS='0@127.0.0.1:40111' \ -e RUNE_CLIENT_ENDPOINT='0.0.0.0:40200' \ -e RUNE_DATA_DIR=/var/lib/rune -v rune-data:/var/lib/rune \ arcanumruna/rune

then, once: the first admin and the topics

rune security bootstrap --admin admin --cluster-key-file secrets/cluster.key --broker localhost:40200 rune ql --user admin --password-file admin.pw -f topics.rql --broker localhost:40200

Throw-away development only: -e RUNE_AUTH=disabled instead of the key. The broker warns every 5 minutes and refuses to start with more than one peer.

The default ports sit in the Linux ephemeral range, and the broker warns at start. Reserve them: sysctl -w net.ipv4.ip_local_reserved_ports=40111,40200,40222.

3-node cluster

Same image, same key and same RUNE_PEERS on every node; only RUNE_NODE_ID and the client port differ. Use 1 node, or an odd count of 3 or more. One host: all three on the host network with distinct ports, reserved with ip_local_reserved_ports=40111-40113,40200-40202,40222-40224.

x-rune: &rune image: arcanumruna/rune network_mode: host shm_size: 256m ulimits: { nofile: { soft: 1048576, hard: 1048576 } } environment: &env RUNE_PEERS: "0@127.0.0.1:40111:40200:40222,1@127.0.0.1:40112:40201:40223,2@127.0.0.1:40113:40202:40224" RUNE_CLUSTER_KEY_FILE: /run/secrets/cluster.key RUNE_TLS_CERT_FILE: /run/secrets/tls.pem RUNE_TLS_KEY_FILE: /run/secrets/tls.key services: rune-1: <<: *rune environment: { <<: *env, RUNE_NODE_ID: "0", RUNE_CLIENT_ENDPOINT: "0.0.0.0:40200" } volumes: ["./secrets:/run/secrets:ro", "rune-data-1:/var/lib/rune"] # rune-2, rune-3: ids 1, 2 · client ports 40201, 40202 · own volume

One node per host: same ports on every host, real addresses in RUNE_PEERS. On a bridge, publish the client port and the node's shard block (8200 + 192 × id, 192 ports); published ports cost p99.

Environment

Everything else has a default derived from the host.

Names & data

Topics exist only through DDL (rune ql). Same rules for topics and views.

Ports

All UDP; with --network host they are the host's ports. Pass --shm-size=256m and a high nofile ulimit.