综合网上的方法和自己的实践找到以下几种方法,记录一下
- 在redis.conf中配置127.0.0.1 ,然后做集群使用的是./redis-trib.rb create --replicas 1 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 ,这种会造成连不上去;
解决方案:删除node.conf文件,重新做集群./redis-trib.rb create --replicas 1 192.168.xxx.xxx:7001 192.168.xxx.xxx:7002 192.168.xxx.xxx:7003 192.168.xxx.xxx:7004 192.168.xxx.xxx:7005 192.168.xxx.xxx:7006
- 还有一种说法就是关闭防火墙,我试过好像没什么用
关闭防火墙的方法为:
永久性生效
开启:chkconfig iptables on
关闭:chkconfig iptables off
即时生效,重启后失效
开启:service iptables start
关闭:service iptables stop
- linux下防火墙加白名单
使用 vi /etc/sysconfig/iptables命令将集群配置的端口号加入白名单;(这个方法亲测有效)
相关文章: