I have set up a master - slave - slave relationship among my 3 instances,
at 127.0.0.1:6379
, 6380
, 6381
.
Instances and sentinels all run on same IP, different ports. and I have set up 3 sentinels(127.0.0.1:26379,26380,26381) with following config:
sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-after-milliseconds mymaster 60000
sentinel failover-timeout mymaster 180000
sentinel config-epoch mymaster 0
sentinel leader-epoch mymaster 53
sentinel parallel-syncs mymaster 1
port 26381
dir "/usr/local/Cellar/redis/3.0.2"
sentinel announce-ip 127.0.0.1
sentinel announce-port 26381
to explain my setup further, I am just trying to test on my local machine if sentinel can respond to manual shutdown of the master. Looking at the sentinel master mymaster, the result is that sentinel does not recognize the master nor the other sentinels:
127.0.0.1:26381> sentinel master mymaster
1) "name"
2) "mymaster"
3) "ip"
4) "127.0.0.1"
5) "port"
6) "6379"
7) "runid"
8) ""
9) "flags"
10) "s_down,o_down,master,disconnected"
11) "pending-commands"
12) "-1"
13) "last-ping-sent"
14) "479567"
15) "last-ok-ping-reply"
16) "479567"
17) "last-ping-reply"
18) "27895"
19) "s-down-time"
20) "419512"
21) "o-down-time"
22) "419512"
23) "down-after-milliseconds"
24) "60000"
25) "info-refresh"
26) "1435337950249"
27) "role-reported"
28) "master"
29) "role-reported-time"
30) "479567"
31) "config-epoch"
32) "0"
33) "num-slaves"
34) "0"
35) "num-other-sentinels"
36) "0"
37) "quorum"
38) "1"
39) "failover-timeout"
40) "180000"
41) "parallel-syncs"
42) "1"
I am not able to change from the config file this sentinel behavior. Is there any way sentinels can talk to each other, and recognize my master?
First thing I would check is whether the master requires authentication. If so you need to set that. Once that works, everything else will fall into place as the sentinels will discover at other through the master and the slaves will be detected the same way,