配置可對外鏈接的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.可以鏈接了,艹!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM