Php Redis连接问题


Php Redis connection issue

我使用php-redis作为会话管理器,遇到了一个奇怪的问题。

我在一台Centos 6.4机器php上运行,在另一台服务器上我有redis,所以如果我禁用php机器的防火墙,一切都很好。

但是一旦我启动iptables,php-redis就不会连接到redis服务器。

I、 当然有一条规则,但显然不起作用:

iptables -A INPUT -p tcp --dport 6379 -j ACCEPT;

我已经重新启动了iptables,并正确检查了规则是否已应用。有人知道发生了什么事吗?

你试过这个吗?

iptables -N REDIS iptables -A REDIS -s localhost -j ACCEPT iptables -A REDIS -s 127.0.0.1 -j ACCEPT iptables -A REDIS -j LOG --log-prefix "unauth-redis-access" iptables -A REDIS -j REJECT --reject-with icmp-port-unreachable iptables -I INPUT -p tcp --dport 6379 -j REDIS

https://serverfault.com/questions/532075/redis-no-route-to-host-when-pinging-a-remote-redis-host