環境:CentOS7、Redis
主要解決Jedis客戶端無法連接Linux上Redis服務問題
1、修改Redis目錄下的redis.conf配置文件
注釋掉bind本地回環地址:bind 127.0.0.1
如果未設置Redis認證密碼,則需要設置保護模式為no:protected-mode no
2、停止CentOS7防火牆或設置規則(這里使用停止方法)
systemctl stop firewalld.service
systemctl stop iptables.service
然后就可以使用了
說明:Jedis使用jedis.auth()進行認證;redis-cli使用:redis-cli -a pass 進行認證