DBAtlas · Database operations atlas

Check Sentinel state, the current master and quorum

RedisSentinel

Command

redis-cli -p 26379 SENTINEL MASTERS
redis-cli -p 26379 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
redis-cli -p 26379 SENTINEL REPLICAS mymaster
redis-cli -p 26379 SENTINEL SENTINELS mymaster
# Are there enough sentinels (quorum and majority) for a failover:
redis-cli -p 26379 SENTINEL CKQUORUM mymaster
redis-cli -p 26379 INFO sentinel

What it does

Lists the masters monitored by Sentinel, the current master address, the known replicas and other sentinels; verifies that the quorum and majority needed for failover are available.

When to use it

When the application connects to the wrong node, when verifying topology after a failover, and before every maintenance.

Caution

Each sentinel reports its own view; GET-MASTER-ADDR-BY-NAME must return the same address on all sentinels, otherwise there is a network partition or a configuration mismatch. s_down/o_down in the flags field or disconnected on a replica needs urgent investigation. The Sentinel port (26379) should be open in the firewall only between sentinels and clients.

Open in DBAtlas →

Related