编辑 Redis 配置文件
编辑 /etc/redis/redis.conf,设置必要的参数。
sudo vim /etc/redis/redis.conf
设置后台运行:
找到以下行,将 no 改为 yes:
daemonize yes
设置密码:
找到以下行,取消注释并设置密码为 Xskdk28U:
requirepass Xskdk28U
启用远程访问(可选):
如果需要允许远程访问,将 bind 行改为:
bind 0.0.0.0
并确保关闭保护模式:
protected-mode no