Learn

$ touch sentinel1.conf
port 5000
sentinel monitor myprimary 127.0.0.1 6379 2
sentinel down-after-milliseconds myprimary 5000
sentinel failover-timeout myprimary 60000
sentinel auth-pass myprimary a_strong_password

Let’s initialise the three Sentinels in three different terminal tabs:

# Tab 1
$ redis-server ./sentinel1.conf --sentinel
# Tab 2
$ redis-server ./sentinel2.conf --sentinel
# Tab3
$ redis-server ./sentinel3.conf --sentinel
# Provides information about the Primary
SENTINEL master myprimary

# Gives you information about the replicas connected to the Primary
SENTINEL replicas myprimary

# Provides information on the other Sentinels
SENTINEL sentinels myprimary

# Provides the IP address of the current Primary
SENTINEL get-master-addr-by-name myprimary
redis> SENTINEL get-master-addr-by-name myprimary
1) "127.0.0.1"
2) "6380"