登录主库
redis-cli
save #保存数据到硬盘
复制到dump.rdb文件到目录服务器
#重新
https://github.com/alibaba/RedisShake
version: '3.8'
services:
redis-shake:
image: golang:1.18
restart: always
#network_mode: host
container_name: redis-shake
volumes:
- "./data:/home"
- "./RedisShake:/RedisShake"
working_dir: /RedisShake
tty: true
privileged: true
docker exec -it redis-shake bash
go env -w GOPROXY=https://goproxy.io,direct
sh build.sh
cd bin
./redis-shake xx.yaml
#vi xx.yaml
type = "sync"
[source]
address = "192.168.1.10:6379"
password = "xxxx"
[target]
type = "standalone"
address = "192.168.1.100:6379"
password = "xxxx"
redis-shake restore.toml
#vi restore.toml
type = "restore"
[source]
rdb_file_path = "/root/dump.rdb"
[target]
type = "standalone"
address = "127.0.0.1:6379"
password = "r-aaaaa:xxxxx"