Redis重启数据丢失

在Linux安装了新的redis[2.8.24],使用redis-cli shutdown关闭redis.然后重启redis服务,redis中数据丢失。

原因可能是dump.rdb路径导致的,默认配置如下:

# 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

你可能感兴趣的:(Redis重启数据丢失)