简体   繁体   English

Redis哨兵将奴隶打倒

[英]Redis sentinel marks slaves as down

I'm trying to setup a typical redis sentinel configuration, with three machines that will run three redis servers and three redis sentinels. 我正在尝试使用三台将运行三台Redis服务器和三台Redis前哨的机器来设置典型的Redis前哨配置。 The Master/Slave part of the redis servers are working OK, but the sentinels are not working. Redis服务器的主/从部分工作正常,但前哨不工作。 When I start two sentinels, the sentinel with the master detects the slaves, but mark them as down after the specified amount of time. 当我启动两个岗哨时,与主岗哨的岗哨检测到从属,但在指定的时间后将其标记为关闭。 I'm running Redis 3.0.5 64-bit in debian jessie machines. 我在debian jessie机器上运行Redis 3.0.5 64位。

8319:X 22 Dec 14:06:17.855 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
8319:X 22 Dec 14:06:17.855 # Sentinel runid is   cdd5bbd5b84c876982dbca9d45ecc4bf8500e7a2
8319:X 22 Dec 14:06:17.855 # +monitor master mymaster xxxxxxxx0 6379 quorum 2
8319:X 22 Dec 14:06:18.857 * +slave slave xxxxxxxx2:6379 xxxxxxx2 6379 @ mymaster xxxxxxx0 6379
8319:X 22 Dec 14:06:18.858 * +slave slave xxxxxx1:6380 xxxxxxx1 6380 @ mymaster xxxxxxx0 6379
8319:X 22 Dec 14:07:18.862 # +sdown slave xxxxxxxx1:6380 xxxxxxx1 6380 @ mymaster xxxxxx0 6379
8319:X 22 Dec 14:07:18.862 # +sdown slave xxxxxx2:6379 xxxxxxx2    6379 @ mymaster xxxxxx0 6379

Sentinel config file: 前哨配置文件:

daemonize yes
pidfile "/var/run/redis/redis-sentinel.pid"
logfile "/var/log/redis/redis-sentinel.log"
bind 127.0.0.1 xxxxxxx0
port 26379
sentinel monitor mymaster xxxxxxx0 6379 2
sentinel down-after-milliseconds mymaster 60000
sentinel config-epoch mymaster 0
sentinel leader-epoch mymaster 0
dir "/var/lib/redis"

Of course, there is connectivity between these machines, as the slaves are working OK: 当然,这些机器之间存在连通性,因为从机工作正常:

7553:S 22 Dec 13:46:33.285 * Connecting to MASTER xxxxxxxx0:6379 <br/>
7553:S 22 Dec 13:46:33.286 * MASTER <-> SLAVE sync started 
7553:S 22 Dec 13:46:33.286 * Non blocking connect for SYNC fired the event.
7553:S 22 Dec 13:46:33.287 * Master replied to PING, replication can     continue...
7553:S 22 Dec 13:46:33.288 * Partial resynchronization not possible (no   cached master)
7553:S 22 Dec 13:46:33.291 * Full resync from master: f637ca8fe003acd09c6d021aed3f89a0d9994c9b:98290
7553:S 22 Dec 13:46:33.350 * MASTER <-> SLAVE sync: receiving 18 bytes from master
7553:S 22 Dec 13:46:33.350 * MASTER <-> SLAVE sync: Flushing old data
7553:S 22 Dec 13:46:33.350 * MASTER <-> SLAVE sync: Loading DB in memory
7553:S 22 Dec 13:46:33.350 * MASTER <-> SLAVE sync: Finished with success
7553:S 22 Dec 14:01:33.072 * 1 changes in 900 seconds. Saving...

I can answer myself. 我可以回答自己。 The problem was that the first IP that appeared in the sentinel conf was the localhost ip. 问题是出现在哨兵conf中的第一个IP是localhost ip。 It needs to be the binding IP. 它必须是绑定IP。 Just in case it serves anyone. 以防万一它服务于任何人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM