在Linux安裝了新的redis[2.8.24],使用redis-cli shutdown關(guān)閉redis.然后重啟redis服務(wù),redis中數(shù)據(jù)丟失。
原因可能是dump.rdb路徑導(dǎo)致的,默認配置如下:
# 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? ./
將路徑配置成絕對路徑,例如:
dir /data/redis