主要解决Jedis客户端无法连接Centos7上Redis服务问题
1、修改Redis目录下的redis.conf配置文件
注释掉bind本地回环地址:bind 127.0.0.1
即开放端口给所有ip
重要:
如果未设置Redis认证密码,则需要设置保护模式为no:protected-mode no
2、停止CentOS7防火墙或设置规则
systemctl stop firewalld(关闭防火墙)
systemctl disable firewalld (禁止重新启用防火墙)
或
firewall-cmd --zone=public --add-port=6379/tcp --permanent (开放6379端口)
systemctl restart firewalld