0

[Redis] [redis-db] 'sentinel slaves ' returns an empty list with a password protected master.

Dear All,

My current redis-cluster setup is the following: 3 Different linux servers

  • srv 1 => redis master + sentinel 1
  • srv 2 => redis slaves + sentinel 2
  • srv 3 => sentinel 3 (sentinel only to avoid split brain situation)

the redis version

redis_version:3.2.3
redis_mode:sentinel
os:Linux 3.10.0-514.21.2.el7.x86_64 x86_64
tcp_port:26379

For some reason sentinel can't find a suitable slave to promote "master" in case of failover.

the redis-cli command "sentinel slaves redis-cluster" returns me an empty list :/ (see my terminal output below) BUT the 3 sentinels can "talk" to each other

the 3 redis-cli sentinel commands I used to get these information:

ip-10-0-0-118.eu-west-1.compute.internal:26379> sentinel slaves redis-cluster
(empty list or set)
ip-10-0-0-118.eu-west-1.compute.internal:26379> sentinel ckquorum redis-cluster
OK 3 usable Sentinels. Quorum and failover authorization can be reached
ip-10-0-0-118.eu-west-1.compute.internal:26379> sentinel failover redis-cluster
(error) NOGOODSLAVE No suitable slave to promote

The configuration files (redis and sentinel) are basics and I used the authentication.

Any idea what would I have misconfigured? so far? :/

Thanks in advance. kr, Orsius.

documentation:

here are my sentinel logs:

. . .
`2361:X 17 Jul 09:20:55.159 # 04ffbe62cec24e9635abbf8985c804e27bb8899b voted for 2cd4dce89889baadc178ba8909b894cf42f184d9 23
2361:X 17 Jul 09:20:55.170 # f5e93cc7c1a109ca8aa4588b92156f7fb5c29c72 voted for 2cd4dce89889baadc178ba8909b894cf42f184d9 23
2361:X 17 Jul 09:20:55.221 # +elected-leader master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:20:55.221 # +failover-state-select-slave master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:20:55.304 # -failover-abort-no-good-slave master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:20:55.357 # Next failover delay: I will not start a failover before Mon Jul 17 09:26:55 2017
2361:X 17 Jul 09:21:41.876 # +new-epoch 24
2361:X 17 Jul 09:21:41.878 # +vote-for-leader f5e93cc7c1a109ca8aa4588b92156f7fb5c29c72 24
2361:X 17 Jul 09:21:41.920 # Next failover delay: I will not start a failover before Mon Jul 17 09:27:42 2017
2361:X 17 Jul 09:27:42.092 # +new-epoch 25
2361:X 17 Jul 09:27:42.092 # +try-failover master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:27:42.099 # +vote-for-leader 2cd4dce89889baadc178ba8909b894cf42f184d9 25
2361:X 17 Jul 09:27:42.102 # f5e93cc7c1a109ca8aa4588b92156f7fb5c29c72 voted for 2cd4dce89889baadc178ba8909b894cf42f184d9 25
2361:X 17 Jul 09:27:42.103 # 04ffbe62cec24e9635abbf8985c804e27bb8899b voted for 2cd4dce89889baadc178ba8909b894cf42f184d9 25
2361:X 17 Jul 09:27:42.165 # +elected-leader master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:27:42.165 # +failover-state-select-slave master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:27:42.248 # -failover-abort-no-good-slave master redis-cluster 10.0.0.223 6379
2361:X 17 Jul 09:27:42.314 # Next failover delay: I will not start a failover before Mon Jul 17 09:33:42 2017`
. . .

If I trust the following forum, sentinel only promote good slaves to new master. source: https://github.com/antirez/redis/issues/1796

some slaves can be good slave to follow below rules.

  • not slave-priority is 0.
  • not demote(it was not old master.)
  • ping reply > info_validity_time
  • info reply > info_validate_time
  • not sdown, odown, disconnected.
4

1 回答 1

1

我的问题实际上是我的 redis-cluster 文件(redis.conf 和 redis-sentinel.conf)中的错误配置,它在“独立”模式中启动了我的两个 redis 实例。

我将工作配置放在我的 github 存储库中:[github.com/orsius/redis-cluster][1]

希望有一天它会帮助某人。

保持冷静,继续使用redis-cluster;)Orsius。

  [1]:https ://github.com/orsius/redis-cluster

于 2017-07-18T07:21:50.793 回答