Redis database error: MISCONF Redis is configured to save RDB snapshots

error message

at java.lang.Thread.run(Thread.java:748)
2022-10-11 17:30:45.230 ERROR Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: 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.] with root cause
io.lettuce.core.RedisCommandExecutionException: 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.
 at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135)
 at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108)
 at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120)
 at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111)
 at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:59)
 at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:646)
 at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:604)
 at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:556)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
 at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
 at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
 at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
 at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
 at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
 at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583)
 at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
 at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
 at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 at java.lang.Thread.run(Thread.java:748)

reason

It is because the redis snapshot is forced to be closed, which leads to the problem that it cannot be persisted. I checked some related solutions on the Internet, and this problem can be avoided by setting the value of stop-writes-on-bgsave-error to no. There are two modification methods, one is to modify through the redis command line, and the other is to directly modify the redis.conf configuration file

1. Command line mode

Example of how to modify the command line:

127.0.0.1:6379> config set stop-writes-on-bgsave-error no

2. Modify the configuration file

Modify the redis.conf file: vi opens the redis.conf file configured by redis-server, and then uses the shortcut matching mode: /stop-writes-on-bgsave-error to locate the stop-writes-on-bgsave-error string, Then set the following yes to no. 

Guess you like

Origin blog.csdn.net/dot_life/article/details/127543873