System commands

System commands #

The 110 commands in the command reference are the data surface. Under them sits a second surface, provided by the Raft/RESP layer, that operations depend on. It is not part of the Redis command set, so it is documented here.

None of these go through the Raft log unless stated, and --try-errors disables the CLUSTER family.

Connection #

CommandReplyNotes
PING [message]PONG, or the messageHandled before dispatch
ECHO messagethe message—
AUTH tokenOK / -unauthorizedRequired first when --auth is set
QUITOK, then the connection closes—
SHUTDOWN(none — the process exits)Equivalent to SIGKILL from the client’s point of view; requires AUTH when configured

Machine #

CommandReplyMeaning
VERSIONbulk stringEngine version, e.g. 1.0.0-rc.1
MACHINEmap of now, uptime, boottime (nanoseconds)Times come from the Raft clock, so every node agrees
MACHINE HUMANsame keys as RFC3339 / durationHuman-readable variant
BARRIEROKA no-op write: when it returns, every previously issued write from this client has been applied

BARRIER is how you get a read-your-writes guarantee across clients or nodes: send BARRIER on the leader, then read on a follower with --openreads.

RAFT #

CommandReplyMeaning
RAFT HELPlist of commands—
RAFT LEADERaddressAdvertised address of the current leader
RAFT INFO [pattern]status mapRaft state, term, applied/committed index, leader, peers
RAFT SERVER LISTarray of id, address, leaderCluster membership
RAFT SERVER ADD id address1Add (or promote) a voter; address is what peers dial
RAFT SERVER REMOVE id1Remove a member
RAFT SNAPSHOT NOWsnapshot idTake a snapshot immediately
RAFT SNAPSHOT LISTarray of id/sizeSnapshots on this node
RAFT SNAPSHOT FILE idabsolute pathWhere the snapshot file lives on the server
RAFT SNAPSHOT READ id [RANGE offset limit]bulk bytesRead the file, whole or in windows
redis-cli -p 11001 RAFT SERVER LIST
1) 1) "id"
   2) "1"
   3) "address"
   4) "127.0.0.1:11001"
   5) "leader"
   6) "true"
...

redis-cli -p 11001 RAFT SERVER ADD 4 10.0.0.14:11001
redis-cli -p 11001 RAFT SERVER REMOVE 4

Membership operations only succeed on the leader; on a follower they fail with the usual redirect error.

CLUSTER #

Redis-cluster-shaped introspection, so that cluster-aware clients and proxies can discover topology:

CommandReplyMeaning
CLUSTER INFOmulti-line stringcluster_state:ok|fail, cluster_known_nodes, cluster_size, …
CLUSTER NODESmulti-line stringOne line per member: id, host:port@port, role (master/slave), leader id, connected, slots
CLUSTER SLOTSarrayOne range covering 0-16383 pointing at the leader

The whole keyspace is reported as a single slot range on the leader, because there is no sharding. The point of these commands is compatibility, not distribution — a client that sees 0-16383 on one master behaves correctly, and every node holds every key anyway.

TICK (internal) #

TICK <timestamp> <seed> is registered as a write command, replicated through the log, and used by the engine itself to advance the machine clock and random seed. The handler rejects malformed calls, but clients have no reason to send it: the Raft layer injects one every tick interval (default 200 ms), and that is what keeps m.Now() and m.Rand() identical across replicas. Write commands are required to use those two functions instead of time.Now()/math/rand for exactly this reason — see COMMAND-AUDIT.md in the repository.

Using the admin surface safely #

  • Wrap admin commands in your own tooling; they take real arguments (RAFT SERVER REMOVE <id> is destructive) and there is no confirmation step.
  • CLUSTER disappears when --try-errors is set, so do not build automation on it for a deployment that needs that flag.
  • The surface is protected only by the shared --auth token. See Security.