redis安装后不能远程连接问题解决

redis安装后,只能使用localhost或者127.0.0.1连接,无法使用公网IP连接!

解决方法:

1、关闭防火墙

service iptables stop

2、 修改配置:

将redis.conf配置文件中bind 127.0.0.1 修改为0.0.0.0,

将/etc/hosts中新增一项   0.0.0.0 localhost 本机hostname

修改后重启redis即可!如:./src/redis-server  ./redis.conf
 

猜你喜欢

转载自blog.csdn.net/yuyecsdn/article/details/89636484