linux redis导出数据,redis数据导入导出集群工具

redis单节点数据导入集群

官方地址:

http://www.oschina.net/p/redis-migrate-tool

## 安装依赖

```

apt-get install autoconf automake libtool libffi-dev make

```

### 安装部署

```

cd /opt/

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

cd redis-migrate-tool/

autoreconf -fvi

./configure

make

src/redis-migrate-tool -h

```

### 配置文件,从单节点写入到集群

```

[root@redis-90 ~]# cat /opt/redis-migrate-tool/read93.conf

[source]

type: single

servers:

- 192.168.56.93:6379

[target]

type: redis cluster

servers:

- 192.168.56.90:6380

[common]

listen: 0.0.0.0:8888

threads: 2

step: 1

mbuf_size: 1024

source_safe: true

```

### 执行命令

```

cd /opt/redis-migrate-tool

src/redis-migrate-tool -c read93.conf -o reids93.log -d

src/redis-migrate-tool -c read93.conf -o reids93.log

```

### 校验数据

```

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

```

### 后台执行

```

nohup src/redis-migrate-tool -c redis75_into_cluster.conf -o redis75_into_cluster.log >/tmp/redis75_into_cluster.log 2>&1 &

```

### 查看拷贝信息

```

redis-cli -h 127.0.0.1 -p 8888

[root@redis-90 ~]# redis-cli -h 127.0.0.1 -p 8888

127.0.0.1:8888> info

# Server

version:0.1.0

os:Linux 3.16.0-4-amd64 x86_64

multiplexing_api:epoll

gcc_version:4.9.2

process_id:8031

tcp_port:8888

uptime_in_seconds:431

uptime_in_days:0

config_file:/opt/redis-migrate-tool/read93.conf

# Clients

connected_clients:1

max_clients_limit:100

total_connections_received:2

# Memory

mem_allocator:jemalloc-0.0.0

# Group

source_nodes_count:1

target_nodes_count:3

# Stats

all_rdb_received:1

all_rdb_parsed:1

all_aof_loaded:0

rdb_received_count:1

rdb_parsed_count:1

aof_loaded_count:0

total_msgs_recv:10000

total_msgs_sent:10000

total_net_input_bytes:188410

total_net_output_bytes:407789

total_net_input_bytes_human:183.99K

total_net_output_bytes_human:398.23K

total_mbufs_inqueue:0

total_msgs_outqueue:0

127.0.0.1:8888>

```

你可能感兴趣的:(linux,redis导出数据)