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 |
後續遇到錯誤會繼續補充