通過查看資料無法連接基本是兩個原因:
1)redis.conf中的bind配置,bind的默認是 127.0.0.1 只可本機訪問,我們改為 bind 0.0.0.0 即所有地址均可訪問。
2)centOS有防火牆,沒有開放6379端口
centOS6關閉防火牆命令:sevice iptables stop
centOS7關閉防火牆命令:systemctl stop firewalld.service #停止
centOS7禁止firewall開機啟動命令:firewall systemctl disable firewalld.service
如果是修改防火牆規則,可以修改:/etc/sysconfig/iptables文件
OK