根据"redis Error condition on socket for SYNC"这个问题的描述,可能会有一些特定的错误条件需要处理。下面是一个处理错误的示例代码: # 处理错误ifisinstance(response,Exception):ifstr(response)=="Error condition on socket for SYNC":# 处理"redis Error condition on socket for SYNC"错误print('处理错误:'...
今天在配置redis主从配置时,从实例报错:Error condition on socket for SYNC: Connection refused 我是在单体机上配置三个实例,实现redis的一主二从。 1.首先,创建三个文件夹,名字分别叫7001、7002、7003(我喜欢将应用安装在tmp下) # 进入/tmp目录 cd /tmp # 创建目录 mkdir 7001 7002 7003 2.拷贝配置文件到...
解决方案:开通6379端口,或者关闭防火墙 当配好主从redis之后,经常会发现,slave无法连接上master。我们使用命令:redis-cli -h (master的IP) -p 6379(master的端口号),如果连不通会出现no route to host,这时我们要查看防火墙,很有可能是防火墙屏蔽了redis的服务了。 Copy 使用iptables -L查看防火墙,之后清空防火墙ip...
3155:S 03 Apr 2023 09:14:10.255 # Error condition on socket for SYNC: No route to host 3155:S 03 Apr 2023 09:14:11.360 * Connecting to MASTER 192.168.133.100:6379 3155:S 03 Apr 2023 09:14:11.360 * MASTER <-> REPLICA sync started 3155:S 03 Apr 2023 09:14:11.361 # Error conditi...
修改master的redis配置文件,在bind 127.0.0.1后面加入本地ip,重启服务
Error condition on socket for SYNC: Connection reset by peer 这个问题是由于主节点的保护模式造成的,将主节点的保护模式关掉,并且将bind ip修改为0.0.0.0让任意ip都可以连接,或者修改为从节点的ip,直接注释掉bind ip是无效的!!! 3.原理 主从复制的原理很简单,是采用RDB进行数据的复制的,每次从机联结都会给主...
Error condition on socket for SYNC: No route to host 这边需要打开服务器的防火墙,用到iptables,安装请移步我上篇博客(请戳)。 iptables -I INPUT -p tcp -m tcp --dport 16379 -j ACCEPT iptables -I INPUT -p tcp -m tcp --dport 26379 -j ACCEPT ...
1946:S 01 Oct 10:44:18.584 # Error condition on socket for SYNC: Connection refused1946:S 01 Oct 10:44:19.603 * Connecting to MASTER localhost:63791946:S 01 Oct 10:44:19.604 * MASTER <-> SLAVE sync started1946:S 01 Oct 10:44:19.604 # Error condition on socket for SYNC: Connection...
= CONN_STATE_CONNECTED) { serverLog(LL_WARNING,"Error condition on socket for SYNC: %s", connGetLastError(conn)); goto error; } /* Send a PING to check the master is able to reply without errors. */ if (server.repl_state == REPL_STATE_CONNECTING) { // CONNECTING阶段,也就是建立...
3872:S 21 Mar 10:55:55.663 # Error condition on socket for SYNC: Connection refused 3872:S 21 Mar 10:55:55.771 * Marking node 38910c5baafea02c5303505acfd9bd331c608cfc as failing (quorum reached). 3872:S 21 Mar 10:55:55.771 # Cluster state changed: fail ...