Deploy
Deployment
Run Nexir as one local node or as a manually initialized multi-node cluster. Each node needs a unique ID, storage path, and reachable advertised addresses.
Single-node deployment
NEXIR_ACCEPT_TERMS=1 \
NEXIR__RAFT__NODE_ID=1 \
NEXIR__SERVER__REDIS_BIND=127.0.0.1:16379 \
NEXIR__SERVER__GRPC_BIND=127.0.0.1:15051 \
NEXIR__PROMETHEUS__BIND=127.0.0.1:19090 \
NEXIR__STORAGE__PATH=/var/lib/nexir/node1 \
nexirInitialize the empty node from another terminal:
redis-cli --raw -p 16379 INIT 1 \
http://127.0.0.1:15051 127.0.0.1:16379Keep the data directory persistent and opaque. Restart with the same node ID, addresses, and directory. A successful write is durable locally, but a one-voter cluster cannot remain available if that node or disk fails.
Three-node deployment
Run each process with a unique node ID, client port, peer port, metrics port, and data directory. On separate hosts, use private routable IPs instead of loopback.
# Node 1
NEXIR_ACCEPT_TERMS=1 \
NEXIR__RAFT__NODE_ID=1 \
NEXIR__SERVER__REDIS_BIND=127.0.0.1:16379 \
NEXIR__SERVER__GRPC_BIND=127.0.0.1:15051 \
NEXIR__PROMETHEUS__BIND=127.0.0.1:19091 \
NEXIR__STORAGE__PATH=/var/lib/nexir/node1 nexir
# Node 2: use 16380, 15052, 19092, /var/lib/nexir/node2
# Node 3: use 16381, 15053, 19093, /var/lib/nexir/node3Bootstrap only through node 1:
redis-cli --raw -p 16379 INIT 1 http://127.0.0.1:15051 127.0.0.1:16379
redis-cli --raw -p 16379 CLUSTER ADD 2 http://127.0.0.1:15052 127.0.0.1:16380
redis-cli --raw -p 16379 CLUSTER ADD 3 http://127.0.0.1:15053 127.0.0.1:16381
redis-cli --raw -p 16379 CLUSTER PROMOTE 2
redis-cli --raw -p 16379 CLUSTER PROMOTE 3Each command should return OK. ADD creates a learner and waits for catch-up; PROMOTE makes it a voter.
Persistence and restart
- Use durable local storage and one path per node.
- Never edit files inside
storage.path. - On graceful shutdown, Nexir stops listeners and replication and flushes storage.
- Restart an intact node with the same identity and paths.
- Do not restore old Raft state onto an existing voter identity.
Expanding one node to three
Start nodes 2 and 3 with empty paths, then run the same CLUSTER ADD and CLUSTER PROMOTE operations through the current leader. Verify zero replication lag with CLUSTER MEMBERS before promoting each learner.
Secure baseline
- Bind all listeners to private interfaces; do not expose them directly to the internet.
- Allow the gRPC port only between intended peers.
- Enable separate client and cluster mTLS trust domains.
- Protect the unauthenticated metrics endpoint.
- Run as a dedicated, unprivileged OS user and restrict data/key permissions.
- After bootstrap, consider
NEXIR__SERVER__ENABLE_ADMIN_COMMANDS=false.
Current deployment scope
Automatic discovery, node replacement, scaling, sharding, Kubernetes manifests, Helm charts, and an operator are not supported public-beta deployment models. Docker Compose examples are for local evaluation, not a complete production recipe.