因为在 redis 中bind 指定的ip 其实为同一网段或localhost 监听ip,在这里配置 内网其他网段或者外网多个ip 后 重启 redis 是不会成功的,
这边建议使用 折中方案,开通iptables 来做处理,例如: 我的是172.0.0.1 ,我想让172.1.10.5 和外网220.10.3.243 访问我服务器的redis ,
1.首先将redis.config 中的bind 全都#屏蔽
#bind 127.0.0.1
线上环境的话建议redis 配置密码
2. 在配置文件中找到 requirepass password
password 为你设置的密码
3.配置iptables规则
通过iptables 允许指定的外网ip访问
原文:https://www.cnblogs.com/yiliuyang/p/9205010.html