如何从从另一台机器复制的快照(rdb 文件)中恢复 redis 数据? [英] How to recover redis data from snapshot(rdb file) copied from another machine?

查看:48
本文介绍了如何从从另一台机器复制的快照(rdb 文件)中恢复 redis 数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 scp 将我的 redis 快照(dump.rdb 文件)传输到远程服务器.我需要在这个远程服务器上运行一个 redis 服务器并从 dump.rdb 文件中恢复数据.我该怎么做?

I transferred my redis snapshot (dump.rdb file) using scp to a remote server. I need to run a redis server on this remote and recover the data from the dump.rdb file. How can I do that?

推荐答案

没有什么可做的.只需在新机器上安装redis服务器,编辑配置文件即可.您只需要更改以下参数以指向您刚刚复制的转储文件的位置即可.

There is nothing specific to do. Just install the redis server on the new machine, and edit the configuration file. You just need to change the following parameters to point to the location of the dump file you have just copied.

# The filename where to dump the DB
dbfilename mydump.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 /data/mydirectory/

终于可以正常启动redis服务器了.

Finally, the redis server can be started in the normal way.

这篇关于如何从从另一台机器复制的快照(rdb 文件)中恢复 redis 数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆