修改redis 配置文件:


/usr/local/redis/redis.conf


bind字段默认为: bind 127.0.0.1 这样只能本机访问redis


将bind 127.0.0.1改为: bind 0.0.0.0


将protected-mode 设置为no 关闭保护模式


protected-mode no


如果以上配置在重启后依旧不生效,请进入redis-cli 执行


config set protected-mode no