SpringBoot集成redis出现的错误

1.Failed opening the RDB file dump.rdb (in server root dir /usr/local/db) for saving: Permission denied

出现上述的原因是更改了redis.conf中的如下,导致了该文件夹没有权限,将db权限更改即可解决。chmoe 755 db

# The working directory.

#

# The DB will be written inside this directory, with the filename specified

# above using the 'dbfilename' configuration directive.

#

# The Append Only File will also be created inside this directory.

#

# Note that you must specify a directory here, not a file name.

dir /usr/local/db/

2.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.

我在用程序测试redis是否可用的时候,调用delete方法出现上述错误。修改redis.conf中的:stop-writes-on-bgsave-error yes

# By default Redis will stop accepting writes if RDB snapshots are enabled

# (at least one save point) and the latest background save failed.

# This will make the user aware (in a hard way) that data is not persisting

# on disk properly, otherwise chances are that no one will notice and some

# disaster will happen.

#

# If the background saving process will start working again Redis will

# automatically allow writes again.

#

# However if you have setup your proper monitoring of the Redis server

# and persistence, you may want to disable this feature so that Redis will

# continue to work as usual even if there are problems with disk,

# permissions, and so forth.

stop-writes-on-bgsave-error no

后续遇到错误会继续补充

猜你喜欢

转载自blog.csdn.net/qq_37162911/article/details/84594602
今日推荐