Getting started #
This page takes you from a clean checkout to a running node, then to a three-node cluster, and ends at the two things that surprise people first when they move from Redis.
Prerequisites #
- Go 1.27.3+. The module declares
go 1.26.0withtoolchain go1.27.3, and CI builds and tests on Go 1.27.3. make(optional — every target is a thingo build).- A RESP client:
redis-cliis enough for everything except typed scan helpers (see Compatibility).
1. Build #
git clone https://github.com/IceFireDB/IceFireDB.git
cd IceFireDB
make localbuild # → ./bin/IceFireDB
make localbuild is go build -ldflags "-X main.BuildVersion=<git sha> -X main.BuildDate=<date>".
make all cross-compiles the release matrix (linux amd64/arm64/armv5/armv6/armv7) — useful for
releases, unnecessary while developing; make run and make run_dev simply go run ..
2. Run one node #
./bin/IceFireDB -a 127.0.0.1:11001 -n 1 -d ./data -l info
That is every default explicitly: the bind address is 127.0.0.1:11001, the node ID is 1, the data
directory is data, the log level is info. The binary prints a banner, then
start with Storage Engine: goleveldb, then the Raft section of the log.
State is written under a per-node directory, so several nodes can share one -d:
data/
└── IceFireDB/
└── 1/
├── main.db/ # the ledis storage (driver-dependent)
├── store/ # Raft log + stable store (leveldb or bolt, see --raft-backend)
└── snapshots/ # Raft snapshots, one directory per snapshot ID
3. First commands #
redis-cli -p 11001
127.0.0.1:11001> SET user:1 '{"name":"ada"}' EX 300
OK
127.0.0.1:11001> GET user:1
"{\"name\":\"ada\"}"
127.0.0.1:11001> TTL user:1
(integer) 299
127.0.0.1:11001> HSET user:1 name ada
(integer) 1
127.0.0.1:11001> HGET user:1 name
"ada"
127.0.0.1:11001> INFO
$...
Note line 4: the same key user:1 holds a string and a hash at the same time. That is not a bug —
see
step 5.
4. A three-node cluster #
Node 1 is the bootstrap node; nodes 2 and 3 join it with -j. Every node keeps its own -d (you can
also share the parent directory, the node ID keeps them apart).
# node 1 — bootstrap
./bin/IceFireDB -a 127.0.0.1:11001 -n 1 -d ./data &
# node 2 — join
./bin/IceFireDB -a 127.0.0.1:11002 -n 2 -d ./data -j 127.0.0.1:11001 &
# node 3 — join
./bin/IceFireDB -a 127.0.0.1:11003 -n 3 -d ./data -j 127.0.0.1:11001 &
Check the topology from any node:
redis-cli -p 11001 CLUSTER INFO
redis-cli -p 11001 CLUSTER NODES
redis-cli -p 11001 RAFT LEADER
Write to the leader, read from a follower:
redis-cli -p 11001 SET cluster:smoke ok # leader → OK
redis-cli -p 11002 GET cluster:smoke # follower → -MOVED error unless --openreads
A follower without --openreads answers a redirect error rather than stale data; add --openreads
when you want follower reads. Membership, snapshots and failure handling are covered in
Clustering.
5. Two things that are not Redis #
- There is no
WRONGTYPE. The engine keeps a separate keyspace per data type, soSET k vandHSET k f xcan both succeed, and a command for the wrong type reads that type’s own (possibly empty) view instead of failing. If your application depends onWRONGTYPEfor type safety, check types at the application layer. - Scan cursors are opaque, and for
HSCANthey are names. Client helpers that parse the cursor as an integer (go-redis’ typedHScan, for example) do not work; use the generic command API.
Both, plus eight more divergences, are in Compatibility.
Where next #
- Configuration — the full flag set with defaults, including TLS, auth, metrics and pprof.
- Command reference — 110 engine commands plus the
RAFT/CLUSTERsystem commands. - Clients — copy-pasteable examples for
redis-cli, Go, Python and Node. - Operations — backup, restore, rolling upgrade, health checks.