Redis 集群迁移工具,基于redis复制,快速,稳定。
迁移的来源可以是:单独的redis实例,twemproxy集群,redis cluster,rdb文件。
迁移的目标可以是:单独的redis实例, twemproxy集群, redis cluster 。
软件编译安装:
$ cd redis-migrate-tool $ autoreconf -fvi $ ./configure $ make $ src/redis-migrate-tool -h
软件运行:
src/redis-migrate-tool -c rmt.conf -o log -d
配置文件示例:从redis cluster集群迁移数据到twemproxy集群
[source] type: redis cluster servers: - 127.0.0.1:6379 [target] type: twemproxy hash: fnv1a_64 hash_tag: "{}" distribution: ketama servers: - 127.0.0.1:6380:1 server1 - 127.0.0.1:6381:1 server2 - 127.0.0.1:6382:1 server3 - 127.0.0.1:6383:1 server4 [common] listen: 0.0.0.0:34345 threads: 8 step: 1 mbuf_size: 512 source_safe: true
状态查看:通过redis-cli连接redis-migrate-tool监控的端口,运行info命令
$redis-cli -h 127.0.0.1 -p 34345 127.0.0.1:34345> info # Server version:0.1.0 os:Linux 2.6.32-573.12.1.el6.x86_64 x86_64 multiplexing_api:epoll gcc_version:4.4.7 process_id:9199 tcp_port:8888 uptime_in_seconds:1662 uptime_in_days:0 config_file:rmt.conf # Clients connected_clients:1 max_clients_limit:100 total_connections_received:3 # Stats all_rdb_parsed:1 total_msgs_recv:7753587 total_msgs_sent:7753587 total_net_input_bytes:234636318 total_net_output_bytes:255384129 total_net_input_bytes_human:223.77M total_net_output_bytes_human:243.55M total_mbufs_inqueue:0 total_msgs_outqueue:0 127.0.0.1:34345>