我正在尝试设置redis集群环境。设置如下(通过链接查看图片):
复制:1主1从
故障转移:3个哨兵
Deployment Setup
我遇到的问题是让s3建立远程连接。事实上,我已经试过简单地部署1个主服务器并尝试sentinel远程连接,但这也失败了。请参阅master和sentinel的简化配置文件。
地方的
redis服务器/path/to/local/redis.conf
本地/redis.conf
bind 127.0.0.1 192.168.20.37 port 6379 dir .
遥远的
redis sentinel/path/to/remote/sentinel.conf
远程/sentinel.conf
bind 127.0.0.1 192.168.20.140 port 16379 sentinel monitor redis-cluster 192.168.20.37 6379 2
在远程映像上启动sentinel后,sentinel无法连接到主映像。请参阅以下输出:
# oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
# Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=15095, just started
# Configuration loaded
* Increased maximum number of open files to 10032 (it was originally set to 1024).
* Running mode=sentinel, port=16379.
# Sentinel ID is 66c95f52fbc72b6a33009c36d9ac6b4e91988b81
# +monitor master mymaster 192.168.20.37 6379 quorum 2
# +sdown master mymaster 192.168.20.37 6379
如果我从本地映像运行sentinel,进行IP更改,它将按预期工作。没有防火墙,没有NAT。我还应该注意,我可以成功地与主服务器建立远程客户端连接。
对于这个看似“简单”的设置有什么建议吗?

最佳答案

我可以通过将sentinel绑定到0.0.0.0来解决这个问题。当您指定localhost+ip时,它似乎只绑定到localhost。

关于redis - Redis Sentinel - 远程监控,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48936965/

10-12 19:03