ErrorRequest: {timestamp=Tue Oct 26 23:58:25 CST 2021, status=500, error=Internal Server Error, exception=org.springframework.dao.InvalidDataAccessApiUsageException, message=MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.; nested exception is redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error., path=/app/user/login}
今天要解决的问题主要有两部分:Redis的快照持久化ERROR,还有服务器磁盘不够的异常。
1.命令行方式
服务器中输入redis-cli,进入redis服务。
config set stop-writes-on-bgsave-error no修改redis的配置
2.修改配置文件。
查找redis在服务器中的路径的命令:whereis redis 或者 which redis
进入redis的文件目录下:
vim 打开redis-server配置的redis.conf文件;
使用快速匹配指令:/stop-writes-on-bgsave-error;
修改stop-writes-on-bgsave-error行的yes 为no;
保存并退出。
#ls /proc/71575 -l #cp -a /home/redis-5.0.8/redis.conf /home/redis-5.0.8/redis.conf.20211026 #sed -i '/^save 900 1/s/save/#save/' /home/redis-5.0.8/redis.conf
#sed -i '/^save 300 10/s/save/#save/' /home/redis-5.0.8/redis.conf
#sed -i '/^save 60 10000/a save ""' /home/redis-5.0.8/redis.conf #sed -i '/^save 60 10000/s/save/#save/' /home/redis-5.0.8/redis.conf
#sed -i '/^stop-writes-on-bgsave-error/s/yes/no/' /home/redis-5.0.8/redis.conf
#sed -i '/^logfile/s/""/"\/home\/redis-5.0.8\/redis.log"/' /home/redis-5.0.8/redis.conf
#egrep "save|stop-writes-on-bgsave-error|^log" /home/redis-5.0.8/redis.conf
#diff /home/redis-5.0.8/redis.conf /home/redis-5.0.8/redis.conf.20211026
#ls -l /home/redis-5.0.8 /home/redis-5.0.8/src
#chown -R nfdw.nfdw /home/redis-5.0.8
#/home/redis-5.0.8/src/redis-server /home/redis-5.0.8/redis.conf ps -ef | grep redis
#kill -9 71575