1. 程式人生 > >redis dump.rdb appendonly.aof 檔案路徑修改

redis dump.rdb appendonly.aof 檔案路徑修改

# 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  ./

-------------------------

這裡預設是啟動後的相對路徑也就是你的redis在哪裡啟動,dump.rdb 檔案或者appendonly.aof
檔案就會產生在啟動所在的目錄;

這也就是有些人重啟後key值消失的原因,那是因為又產生了其他ump.rdb 檔案或者appendonly.aof

這裡建議改成絕對路徑

dir /usr/local/redis/data/