redis主从问题

vcirk6k6  于 2021-06-09  发布在  Redis
关注(0)|答案(2)|浏览(374)

我们在prod环境中设置了keepalive的master和slave,所以问题是我的master变成了slave,slave变成了master,所以这个问题的原因是什么?我怎样才能找到是否有网络波动或其他原因。

omjgkv6w

omjgkv6w1#

这和乌利米特家族有关。基本上,linux系统对打开的文件描述符的数量有一个严格的限制,即 256 默认情况下,请将以下行添加到 /etc/limits.conf ```

  • hard nofile 500000
  • soft nofile 500000

root hard nofile 500000
root soft nofile 500000

ie3xauqp

ie3xauqp2#

您可以检查sentinel的日志文件。日志文件的路径在sentinel.conf中定义,如下所示。


# Specify the log file name. Also the empty string can be used to force

# Sentinel to log on the standard output. Note that if you use standard

# output for logging but daemonize, logs will be sent to /dev/null

logfile ""

在您的情况下,可能会发生网络问题,sentinel会将从属节点提升为新的主节点。后来,当老主人有空的时候,哨兵就会把它作为奴隶带进来,因为新主人已经在运行了。您必须配置日志文件,以便将来可以在日志中看到此转换的证据。

相关问题