关于redis集群 no reachable node in cluster的错误(在命令行正常,而在eclipse运行失败)

来源:互联网 发布:域名授权码 编辑:程序博客网 时间:2024/06/06 03:24

转载:http://blog.csdn.net/wojiushifeng1992/article/details/72904087


问题是防火墙没关,可以在命令行做以下配置即可

红色字是需要操作的,完成就ok了


[root@bogon redis-cluster]#  vim /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 7006 -j ACCEPT
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7001 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7002 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7003 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7004 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7005 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7006 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
~
"/etc/sysconfig/iptables" 22L, 1079C written                  
[root@bogon redis-cluster]# ll
total 76
drwxr-xr-x. 2 root root  4096 Jun  7 04:01 redis01
drwxr-xr-x. 2 root root  4096 Jun  7 04:01 redis02
drwxr-xr-x. 2 root root  4096 Jun  7 03:55 redis03
drwxr-xr-x. 2 root root  4096 Jun  7 04:01 redis04
drwxr-xr-x. 2 root root  4096 Jun  7 04:01 redis05
drwxr-xr-x. 2 root root  4096 Jun  7 03:55 redis06
-rwxr-xr-x. 1 root root 48141 Jun  7 01:49 redis-trib.rb
-rwxr--r--. 1 root root   270 Jun  7 02:05 start-all.sh
[root@bogon redis-cluster]#  service iptables restart
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]
iptables: Applying firewall rules: [  OK  ]


阅读全文
0 0