yx-book

redis 同步工具redis-migrate-tool实时同步数据

redis cluster集群 、sentinel模式、twemproxy模式都可以使用redis-migrate-tool 工具同步数据

从github 上克隆代码   https://github.com/tanruixing88/redis-migrate-tool

安装相关依赖包:

yum install autoconf automake libtool bzip2

git clone https://github.com/JokerQueue/redis-migrate-tool.git

cd redis-migrate-tool

autoreconf -fvi

 ./configure

make

src/redis-migrate-tool -h

src/redis-migrate-tool -v

rmt.conf 是原始的配置文件

cat rmt.conf

[source]
type: redis cluster
servers:
- 172.0.0.1:6379
- 172.0.0.1:7000
- 172.0.0.1:7001
- 172.0.0.2:6379
- 172.0.0.2:7000
- 172.0.0.2:7001
- 172.0.0.3:6379
- 172.0.0.3:7000
- 172.0.0.3:7001
redis_auth:admin #有密码配置

[target]
type: redis cluster
servers:
- 172.1.0.1:6379
- 172.1.0.1:7000
- 172.1.0.1:7001
- 172.1.0.2:6379
- 172.1.0.2:7000
- 172.1.0.2:7001
- 172.1.0.3:6379
- 172.1.0.3:7000
- 172.1.0.3:7001
redis_auth:admin #密码

[common]
listen: 0.0.0.0:9999

开始同步程序:

/opt/redis-migrate-tool/src/redis-migrate-tool -c /opt/redis-migrate-tool/rmt.conf -o /opt/redis-migrate-tool/rmt_tom.log -d

停掉同步程序:

kill -9 `ps -ef|grep "/opt/redis-migrate-tool/src/redis-migrate-tool"|grep -v grep|awk \'{print $2}\'`

数据检查:

src/redis-migrate-tool -c rmt.conf -o rmt_tom.log -C redis_check

具体使用参数参考地址:https://github.com/tanruixing88/redis-migrate-tool

分类:

技术点:

相关文章:

  • 2021-10-14
  • 2021-10-04
  • 2021-10-04
  • 2022-02-14
  • 2021-06-20
  • 2022-02-14
  • 2022-02-25
  • 2021-07-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2020-05-26
  • 2022-02-28
  • 2021-11-28
  • 2021-08-27
  • 2022-01-21
相关资源
相似解决方案