28 redis
输入时:
redis-cli救了
我不知道dump.rdb保存在哪里(因为redis是作为服务而不是在我的本地目录中启动的).
有没有我可以指定一个文件名来"保存",所以我输入如下内容:
redis-cli save~/db-2012-06-24.rdb
谢谢
Chr*_*fer 27
为了更有帮助...如何查找或设置redis保存dump.rdb文件的位置(ubuntu服务器):首先找到你redis.conf文件:在你的终端运行中:
ps -e aux | grep redis
Run Code Online (Sandbox Code Playgroud)
我找到了我的redis.conf文件:
var/etc/redis/
Run Code Online (Sandbox Code Playgroud)
如果您的位置相同,请使用以下命令打开文件:
pico var/etc/redis/redis.conf
Run Code Online (Sandbox Code Playgroud)
寻找:
# The filename where to dump the DB
dbfilename dump.rdb
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# Also the Append Only File will be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /var/lib/redis
Run Code Online (Sandbox Code Playgroud)
根据您的"dbfilename"和"dir"的设置,这是您找到redis dump.rdb文件的位置.
更新:要查看您的redis配置,请执行以下操作:
redis-cli CONFIG GET *
Run Code Online (Sandbox Code Playgroud)
eyo*_*ssi 21
您可以在redis.conf文件(启动服务器)上设置文件位置,查看服务器配置:
# The filename where to dump the DB
dbfilename dump.rdb
Run Code Online (Sandbox Code Playgroud)
找到当前保存文件的位置,这取决于你如何启动服务器 - 你有redis-server文件 - 我认为你可以找到它ps -e aux | grep redis或者ps -e | grep redis
btk*_*btk 14
在我的(默认,Ubuntu)设置上,db文件位于
/var/lib/redis/redis.rdb
Run Code Online (Sandbox Code Playgroud)
正如Christoffer指出的那样,您可以从命令行客户端看到所有设置
CONFIG GET *
Run Code Online (Sandbox Code Playgroud)
Rab*_*bea 12
一个衬里获取目录和转储文件名
echo "CONFIG GET *" | redis-cli | grep -e "dir" -e "dbfilename" -A1
Run Code Online (Sandbox Code Playgroud)