redis问题解决:Error condition on socket for SYNC: No route to host
第一种方案:
1.telnet ip port 是否通
2.使用netstat -tnlp 查询IP地址是127.0.0.1而不是0.0.0.0(127.0.0.1代表只能本机使用)
3.修改master中redis.conf中bind绑定0.0.0.0
2.重启master服务
如果第一种方案行不通,那就使用第二种方案;
第二种方案:
1.关闭防火墙:service iptables stop
2.如果出现以下异常
Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.
(其他异常也可以试下)
3.进入/etc/sysconfig/目录下查询有没有iptables文件
4.如果没有,使用systemctl stop firewalld 关闭防火墙
5.使用yum install iptables-services 安装或者更新服务
6.service iptables stop尝试下关闭服务器
7.关闭成功无异常,重启maste和slave,进入redis-cli 输入info就能看到maste和slave信息了