-
Notifications
You must be signed in to change notification settings - Fork 693
快速开始:从 dump.rdb 恢复数据
suxb201 edited this page Sep 26, 2022
·
2 revisions
这里举几个例子,演示使用 redis-shake 将 Redis 的备份文件(RDB文件)中的数据恢复至其他 Redis。
绝对路径为:
/root/dump.rdb
- 地址:r-aaaaa.redis.zhangbei.rds.aliyuncs.com
- 端口:6379
- 密码:r-aaaaa:xxxxx
- 地址:
- 192.168.0.1:6379
- 192.168.0.2:6379
- 192.168.0.3:6379
- 192.168.0.4:6379
- 密码:r-ccccc:xxxxx
- 修改
restore.toml
为:
type = "restore"
[source]
rdb_file_path = "/root/dump.rdb"
[target]
type = "standalone"
address = "127.0.0.1:6379"
password = "r-aaaaa:xxxxx"
- 运行 redis-shake:
redis-shake restore.toml
- 修改
restore.toml
为:
type = "restore"
[source]
rdb_file_path = "/root/dump.rdb"
[target]
type = "cluster"
address = "192.168.0.1:6379" # 这里写集群中的任意一个节点的地址即可
password = "r-ccccc:xxxxx"
- 运行 redis-shake:
redis-shake restore.toml