Skip to content
Redis CLI

Usuarios ACL y operaciones de cluster

Gestiona usuarios ACL, herramientas redis-check y resharding del cluster.

#acl#cluster#security#ops

Code

redis-cli
# --- ACL (Redis 6+) ---
127.0.0.1:6379> ACL WHOAMI              # current user
127.0.0.1:6379> ACL LIST                # all users (with rules)
127.0.0.1:6379> ACL GETUSER default
127.0.0.1:6379> ACL SETUSER alice on >alicepass ~user:* +get +set +del
127.0.0.1:6379> ACL SETUSER alice +@read -@dangerous   # category-based
127.0.0.1:6379> ACL DELUSER alice
127.0.0.1:6379> ACL LOG                 # security events (denied commands)
127.0.0.1:6379> ACL SAVE                # persist to users.acl (with CONFIG REWRITE)

# --- Cluster (Redis Cluster) ---
127.0.0.1:6379> CLUSTER INFO            # cluster state, slots, size
127.0.0.1:6379> CLUSTER NODES           # all nodes (id, addr, flags, slots)
127.0.0.1:6379> CLUSTER MYID
127.0.0.1:6379> CLUSTER COUNTKEYSINSLOT 1234
127.0.0.1:6379> CLUSTER KEYSLOT mykey   # which slot a key hashes to

# Cluster mode CLI auto-routes by keyslot (-c)
$ redis-cli -c -h cluster.example.com -p 7000 SET foo bar
# (redirected to the slot owner automatically)

# Add a node, reshard (manual or with the helper)
$ redis-cli --cluster create node1:7000 node2:7000 node3:7000 --cluster-replicas 1
$ redis-cli --cluster reshard node1:7000 \
    --cluster-from <src-node-id> --cluster-to <dst-node-id> \
    --cluster-slots 1000 --cluster-yes

# Offline repair / inspection
$ redis-check-rdb /var/lib/redis/dump.rdb
$ redis-check-aof --fix /var/lib/redis/appendonly.aof