我有1个主Redis服务器和2个从Redis服务器。我在所有3台服务器中都配置了sentinel.conf相同(前哨端口26379)。
启动Sentinel时,我收到一条错误消息,内容如下:
16765:X 22 May 2019 12:19:53.215 # Configuration loaded
16766:X 22 May 2019 12:19:53.217 * Increased maximum number of open files to 10032 (it was originally set to 1024).
16766:X 22 May 2019 12:19:53.217 # Could not create server TCP listening socket slave-1-ip:26379: bind: Cannot assign requested address
16766:X 22 May 2019 12:19:53.217 # Could not create server TCP listening socket slave-2-ip:26379: bind: Cannot assign requested address
16766:X 22 May 2019 12:19:53.218 * Running mode=sentinel, port=26379.
16766:X 22 May 2019 12:19:53.218 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
16766:X 22 May 2019 12:19:53.218 # Sentinel ID is f3738395bf4099ca3faebc7ea7caaa45e93b40a3
16766:X 22 May 2019 12:19:53.218 # +monitor master redis-01 masterip 6379 quorum 2
16766:X 22 May 2019 12:21:23.219 # +sdown master redis-01 masterip 6379
16766:X 22 May 2019 12:58:00.013 # +sdown slave slave-1-ip:6379 slave-1-ip 6379 @ redis-01 masterip 6379
我的sentinel.conf文件:
protected-mode no
port 26379
daemonize yes
sentinel monitor redis-01 master-ip 6379 2
# sentinel announce-ip 1.2.3.4
sentinel down-after-milliseconds redis-01 90000
sentinel failover-timeout redis-01 90000
sentinel parallel-syncs redis-01 2
# Generated by CONFIG REWRITE
protected-mode no
sentinel auth-pass redis-01 password
sentinel config-epoch redis-01 0
sentinel leader-epoch redis-01 0
sentinel known-replica redis-01 slave-1-ip 6379
sentinel known-replica redis-01 slave-2-ip 6379
sentinel current-epoch 0
我想念什么?
我该怎么做才能使哨兵工作完美?
更新:
我将哨兵端口更改为所有主机上的其他端口(host1,host2和host3分别为26379、26380、26381,以前在所有26379上都相同)。
现在工作正常了
但是,为什么不能在所有主机的同一端口上运行哨兵?而我可以在所有主机上都运行Redis服务器(6379)吗?