配置可对外链接的Redis

链接服务器的Redis

telnet 192.168.1.200 6379
Trying 192.168.1.200...
telnet: Unable to connect to remote host: Connection refused

链接不上,有可能是防火墙阻隔,或者服务没有对外开放。
1.修改redis配置
去掉bind

去除保护模式protected-mode或者加上密码requirepass

重启redis

redis-cli -h 127.0.0.1 -p 6379 shutdown
redis-server /usr/local/redis/etc/redis.conf

2.防火墙开启端口

vim /etc/sysconfig/iptables

/etc/init.d/iptables restart

3.可以链接了,艹!


posted @ 2018-10-26 15:01  TBHacker  阅读(1200)  评论(0编辑  收藏  举报