图形化Client连接Redis-Server报can't connect to redis-server
1、检查配置文件中是否限制的Client地址的接入
1)修改配置文件redis.conf
1.1)注释掉 bind 127.0.0.1
1.2)保护方式修改为no,即【protected-mode yes】改为【protected-mode no】
2、检查防火墙是否放开相应对口
1)检查防火墙状态
[root@localhost bin]# /etc/init.d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
2)放开6379端口(redis默认端口,如修改过,则放开相应端口)
2.1)vi /etc/sysconfig/iptables
在【-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 6379 -j ACCEPT
2.2)重启防火墙 /etc/init.d/iptables restart
3、客户端重新连接