Redis主从配置异常解决:Error condition on socket for SYNC: Connection refused
来源:互联网 发布:淘宝详情页ps技巧 编辑:程序博客网 时间:2024/06/10 11:09
Redis主从配置异常解决:Error condition on socket for SYNC: Connection refused
在docker中搭建的redis主从集群时,从服务器上的redis日志报错:
32677:S 08 Feb 16:14:38.947 * Connecting to MASTER 172.168.10.70:637932677:S 08 Feb 16:14:38.948 * MASTER <-> SLAVE sync started32677:S 08 Feb 16:14:38.948 # Error condition on socket for SYNC: Connection refused32677:S 08 Feb 16:14:39.950 * Connecting to MASTER 172.168.10.70:637932677:S 08 Feb 16:14:39.950 * MASTER <-> SLAVE sync started32677:S 08 Feb 16:14:39.950 # Error condition on socket for SYNC: Connection refused32677:S 08 Feb 16:14:40.952 * Connecting to MASTER 172.168.10.70:637932677:S 08 Feb 16:14:40.952 * MASTER <-> SLAVE sync started32677:S 08 Feb 16:14:40.953 # Error condition on socket for SYNC: Connection refused
解决方案:
在redis主服务器上的redis.conf中修改bind字段,将
bind 127.0.0.1
修改为
bind 0.0.0.0
又或者直接注释掉bind字段
# bind 127.0.0.1
原因:
如果redis主服务器绑定了127.0.0.1,那么跨服务器IP的访问就会失败,从服务器用IP和端口访问主的时候,主服务器发现本机6379端口绑在了127.0.0.1上,也就是只能本机才能访问,外部请求会被过滤,这是linux的网络安全策略管理的。如果bind的IP地址是172.168.10.70,那么本机通过localhost和127.0.0.1、或者直接输入命令redis-cli登录本机redis也就会失败了。只能加上本机ip才能访问到。
所以,在研发、测试环境可以考虑bind 0.0.0.0,线上生产环境建议绑定IP地址。
0 0
- Redis主从配置异常解决:Error condition on socket for SYNC: Connection refused
- Redis主从配置异常解决:Error condition on socket for SYNC: Connection refused
- Redis主从配置异常解决:Error condition on socket for SYNC: Connection refused
- 配置redis主从时报错:Error condition on socket for SYNC: Connection refused
- 配置redis主从时报错:Error condition on socket for SYNC: Connection refused
- android socket通信 Connection refused异常
- socket error:[Errno 111]Connection refused 问题
- Android解决异常apk on device '0292bea1': Unable to open sync connection!
- SQL Server JDBC Connection Errors: Error establishing socket, connection refused...
- redis connection refused
- [SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
- 点击pythonIDLE报错Socket error:Connection refused
- error connection refused
- 异常:Listener refused the connection with the follow ing error:
- ERROR: opening port for MGR MGR (Connection refused).
- ERROR: opening port for REPLICAT REPFULL (Connection refused).
- php-fpm监听socket类型-解决Connection refused
- 解决redis connection refused: connect遇到的坑
- 第二章:Java_基本语法_4 程序流程控制
- Redis发布与订阅的参数
- 《跟我一起写makefile》(笔记7--运行make的参数选择)
- TextView 利用html换行和加粗字体
- 用户态文件系统fuse学习
- Redis主从配置异常解决:Error condition on socket for SYNC: Connection refused
- Java设计模式之行为型模式(迭代器模式)
- 使用GDB调试C库
- poj1595
- C++命名空间
- wpf 模板内控件在后台CS文件里面获取属性值
- 清除浮动最好的两种方式
- spring boot(六):如何优雅的使用mybatis
- keytool生成keystore、truststore、证书