解决方式一: 不需要密码连接
1. 关闭防火墙
查看防火墙状态 : iptables -L
关闭防火墙 : service firewalld stop
开启防火墙 : service firewalld start
# 输入 firewall-cmd --query-port=6379/tcp 查看端口是否开启
2. 修改 redis.conf 文件 ( 查找文件名 “/”+ 你想搜索的名称 例如 /bind 127.0)
#bind 127.0.0.1 //本地链接限制 这里注释掉
protected-mode no // (保护模式 默认 yes 这里修改为 no) 其他主机的客户端连接到ReDIS 即使没有配置身份验证,也没有特定的接口集
解决方式二: 需要密码连接
1. 关闭防火墙
查看防火墙状态 : iptables -L
关闭防火墙 : service firewalld stop
2. 修改 redis.conf 文件
#bind 127.0.0.1 //本地链接限制
protected-mode yes // (保护模式 默认 yes 这里不做修改)