Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

God recommends Redis cluster migration tool: redis-migrate-tool

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Redis cluster migration tool, based on redis replication, fast and stable.

Characteristics

fast

Multithreading

Replication based on redis

Real-time migration

In the process of migration, the source cluster does not affect the provision of services.

Heterogeneous migration

Support Twemproxy cluster, redis cluster cluster, rdb file and aof file

Filtering function

When the target cluster is Twemproxy, the data will skip Twemproxy and be directly imported to the backend redis

Migration status display

Perfect data sampling check

The source of the migration tool can be: individual redis instance, twemproxy cluster, redis cluster,rdb file, aof file.

The target of the migration tool can be: individual redis instance, twemproxy cluster, redis cluster,rdb file.

Version description

Https://github.com/vipshop/redis-migrate-tool # only supports redis3 and below

Https://github.com/tanruixing88/redis-migrate-tool # is modified based on the above version and supports redis4 and above

Install git clone https://github.com/tanruixing88/redis-migrate-tool.gitredis-migrate-toolautoreconf-fvi./configuremakecp src/redis-migrate-tool / usr/local/bin/redis-migrate-tool configuration file rmt.conf depending on yum-y install automake libtool autoconf bzip2

Example configuration file: migrating data from a redis cluster cluster to a twemproxy cluster

[source] type: redis clusterservers:-127.0.0.1 type 6380-127.0.0.1 [target] type: twemproxyhash: fnv1a_64hash_tag: "{}" distribution: ketamaservers:-127.0.0.1 twemproxyhash:-127.0.0.1 twemproxyhash: "{}" distribution: ketamaservers:-127.0.0.1twemproxyhash 6380 1 server1-127.0.0.118881 server3-127.0.0.1: 6383:1 server4[common] listen: 0.0.0.0:8888threads: 2step: 1mbuf_size: 1024source_safe: true

Example configuration file: migrating data from a redis cluster cluster to another cluster cluster

[source] type: redis clusterservers:-127.0.0.1: 8379 [target] type: redis clusterservers:-127.0.0.1: 7379 [common] listen: 0.0.0.0pur8888

Configuration file example: recovering data from a rdb file to a redis cluster cluster

[source] type: rdb fileservers:-/ data/redis/dump1.rdb-/ data/redis/dump2.rdb-/ data/redis/ dump3.rdb [target] type: redis clusterservers:-127.0.0.1: 7379 [common] listen: 0.0.0.0 rmt.conf 8888 run / usr/local/bin/redis-migrate-tool-c rmt.conf-o log-d status

Connect to the port monitored by redis-migrate-tool through redis-cli and run the info command

Redis-cli-h 127.0.0.1-p 8888127.0.0.1 redis-cli 8888 > info# Serverversion:0.1.0os:Linux 2.6.32-573.12.1.el6.x86_64 x86_64multiplexing_api:epollgcc_version:4.4.7process_id:9199tcp_port:8888uptime_in_seconds:1662uptime_in_days:0config_file:/ect/rmt.conf# Clientsconnected_clients:1max_clients_limit:100total_connections_received:3# Memorymem_allocator:jemalloc- 4.0.4# Groupsource_nodes_count:32target_nodes_count:48# Statsall_rdb_received:1all_rdb_parsed:1all_aof_loaded:0rdb_received_count:32rdb_parsed_count:32aof_loaded_count:0total_msgs_recv:7753587total_msgs_sent:7753587total_net_input_bytes:234636318total_net_output_bytes:255384129total_net_input_bytes_human:223.77Mtotal_net_output_bytes_human:243.55Mtotal_mbufs_inqueue:0total_msgs_outqueue: 0127.0.1 log 8888 > data verification / usr/local/bin/redis-migrate-tool-c rmt.conf-o log-C redis_checkCheck job is running...Checked keys: 1000Inconsistent value keys: 0Inconsistent expire keys: 0Other check error keys: 0Checked OK keys: 1000All keys checked OKcheck check job finished Used 1.041s original address: https://www.linuxprobe.com/redis-migrate-tool.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report