Identify if sentinel node is down

209 views
Skip to first unread message

Vikas goyal Goal

unread,
Jun 21, 2021, 8:38:40 AM6/21/21
to Redis DB
Hi,

I have redis sentinel setup with 5 sentinels. 
I want to the monitoring of REDIS HA. For this I want to check if any of the sentinel instance is down.  Is there any command which can tell me if any of the sentinel instance is down? 
I will use that command in one shell script to check if any Sentinel instance goes down. 


I tried "info sentinel" but this gives number of configured sentinel. It does not give the status of any particular sentinel instance if it is down.

Regards,
Vikas

Manish Arora

unread,
Jun 23, 2021, 10:48:38 AM6/23/21
to Redis DB
You only need to specify the masters to monitor, giving to each separated master (that may have any number of replicas) a different name. There is no need to specify replicas, which are auto-discovered. 

sentinel monitor <master-group-name> <ip> <port> <quorum>

For example:
sentinel monitor mymaster 127.0.0.1 6379 2 
sentinel down-after-milliseconds mymaster 60000 
sentinel failover-timeout mymaster 180000 
sentinel parallel-syncs mymaster 1 

sentinel monitor resque 192.168.1.3 6380 4 
sentinel down-after-milliseconds resque 10000 
sentinel failover-timeout resque 180000 
sentinel parallel-syncs resque 5

Sentinel will update the configuration automatically with additional information about replicas (in order to retain the information in case of restart). The configuration is also rewritten every time a replica is promoted to master during a failover and every time a new Sentinel is discovered.

The example configuration above basically monitors two sets of Redis instances, each composed of a master and an undefined number of replicas. One set of instances is called mymaster, and the other resque.

For more details, you may refer to the following documentation: https://redis.io/topics/sentinel 

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

Manish Arora

unread,
Jul 8, 2021, 7:25:53 PM7/8/21
to Redis DB
My response is a bit delayed. I realized your question was slightly different. You were asking about how to do a health check on sentinels. 

Option 1:
From the CLI you can run the following command to get the state of Sentinel
SENTINEL SENTINELS <master name> Show a list of sentinel instances for this master, and their state.

Option 2:
From the master, you can look for:
$ redis-cli -p 5000 
127.0.0.1:5000> sentinel master mymaster

filter for "num-other-sentinels" this will tell you how many Sentinels master knows off. 

Manish
Reply all
Reply to author
Forward
0 new messages