1、防火墙添加6379端口

确保防火墙开启了对6379端口的放行。

2、修改redis.conf

在 redis.conf 中修改以下参数

# 允许任何主机连接、访问
bind 127.0.0.1 改为 bind 0.0.0.0

# 关闭保护模式
protected-mode yes 改为 protected-mode no

# 允许启动后在后台运行,即关闭命令行窗口后仍能运行
daemonize no 改为 daemonize yes


./redis-server ../redis.conf