Get started

Quick start

Install Nexir, initialize one local voter, and use redis-cli to write and read data.

Prerequisites

  • A supported Linux or macOS host.
  • redis-cli or another RESP2-compatible client.
  • Free local ports 16379, 15051, and 19090.

1. Install Nexir

Linux or macOS:

curl --proto '=https' --tlsv1.2 -sSf \
  https://nexir.com/install.sh | sh -s -- --accept-terms

2. Start a local node

Choose an empty, persistent data directory. Environment variables override the bundled defaults. The installer has already recorded terms acceptance.

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=./data/quickstart-node1 \
nexir

Expected result: Nexir stays in the foreground. Leave this terminal open. Plaintext gRPC and metrics warnings are expected for this local-only example.

3. Initialize exactly once

In a second terminal:

redis-cli --raw -p 16379 INIT 1 \
  http://127.0.0.1:15051 127.0.0.1:16379

Expected output: OK. The first argument must equal NEXIR__RAFT__NODE_ID.

Run INIT once, on one nodeInitializing another fresh node creates an independent cluster with a different cluster UUID. Other nodes join through CLUSTER ADD, not INIT.

4. Verify the node

redis-cli --raw -p 16379 PING
# PONG

redis-cli --raw -p 16379 CLUSTER INFO
# includes cluster_state:ok and nexir_role:leader

5. Write and read data

redis-cli --raw -p 16379 SET hello world
# OK

redis-cli --raw -p 16379 GET hello
# world

redis-cli --raw -p 16379 SET session:1 token EX 60
# OK

redis-cli --raw -p 16379 TTL session:1
# 60

redis-cli --raw -p 16379 DEL session:1
# 1

Nexir's command surface is scalar-only: GET, SET, DEL, and the TTL family. Hashes, sets, lists, sorted sets, counters, and multi-key commands are not available. See Redis compatibility for the complete list.

6. Stop safely

Press Ctrl+C in the Nexir terminal. Nexir stops its listeners, shuts down replication, flushes storage, and exits. Restart with the same node ID, addresses, and storage path to reopen the node.