0

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

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

但是一旦我启动 iptables,php-redis 将无法连接到 redis 服务器。

我当然有一个规则,但显然是行不通的:

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

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

4

1 回答 1

0

你试过这个吗?

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

于 2014-06-22T16:49:36.913 回答