tar -zxvf redis-5.0.5.tar.gz mv redis-5.0.5 /usr/local cd /usr/local/redis-5.0.5 make cd src make install PREFIX=/usr/local/redis
cd .. mkdir /usr/local/redis/etc mv redis.conf /usr/local/redis/etc/
useradd -d /home/redis redis
cp /usr/local/redis/etc/redis.conf /home/redis cd /home/redis/ chmod 640 redis.conf 设置redis启动文件权限 --------------------------------------------------------------------------------------------
vim /home/redis/redis.conf pidfile /var/run/redis.pid 修改为 pidfile /home/redis/run/redis.pid dir ./ 修改为 dir /home/redis/redis logfile "" 添加为 logfile "/home/redis/log/redis.log" port 6379 修改为 port 8972 bind 0.0.0.0 登录阿里云控制台做安全组规则开放端口和授权指定IP
报错信息 UnhandledPromiseRejectionWarning: ReplyError: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
解决方法
方式一: 检查磁盘空间,检查磁盘是否真的被使用完毕了
df -h
方式二: $ redis-cli -h 41.188.42.198 -a zkjs_20191113 -p 8972 config set stop-writes-on-bgsave-error no