关闭 protected-mode
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.108 config set protected-mode no
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.112 config set protected-mode no
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.114 config set protected-mode no
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.115 config set protected-mode no
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.116 config set protected-mode no
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.117 config set protected-mode no
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.118 config set protected-mode no
取消所有节点密码
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.108 config set requirepass ''
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.112 config set requirepass ''
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.114 config set requirepass ''
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.115 config set requirepass ''
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.116 config set requirepass ''
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.117 config set requirepass ''
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.118 config set requirepass ''
导入数据
/usr/local/redis/bin/redis-cli --cluster import 192.168.174.108:26379 --cluster-from 192.168.174.118:26379 --cluster-copy --cluster-replace
>>> Importing data from 192.168.174.118:26379 to cluster 192.168.174.108:26379
>>> Performing Cluster Check (using node 192.168.174.108:26379)
M: 2c2f409a5893ed9c6087d705126f8df80a746841 192.168.174.108:26379
slots:[0-5460] (5461 slots) master
1 additional replica(s)
M: 53eadf87db7fd4efa4a14924eb80178f6e92c5e5 192.168.174.114:26379
slots:[8191],[10923-16383] (5462 slots) master
1 additional replica(s)
M: 1538d933904b5093bfb92f4ef8df33d218cee3a8 192.168.174.112:26379
slots:[5461-8190],[8192-10922] (5461 slots) master
1 additional replica(s)
S: c95a6697886121a6743e50d41a84512e496bc663 192.168.174.115:26379
slots: (0 slots) slave
replicates 53eadf87db7fd4efa4a14924eb80178f6e92c5e5
S: c807ec73ea369b4dd88f9a6e16cd3abb8b01732b 192.168.174.116:26379
slots: (0 slots) slave
replicates 2c2f409a5893ed9c6087d705126f8df80a746841
S: 4fdec8f3a6f42aee6c892fb175335c746da7f749 192.168.174.117:26379
slots: (0 slots) slave
replicates 1538d933904b5093bfb92f4ef8df33d218cee3a8
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
*** Importing 100 keys from DB 0
Migrating testkey84 to 192.168.174.108:26379: OK
Migrating testkey68 to 192.168.174.112:26379: OK
Migrating testkey11 to 192.168.174.114:26379: OK
Migrating testkey96 to 192.168.174.108:26379: OK
Migrating testkey5 to 192.168.174.108:26379: OK
Migrating testkey42 to 192.168.174.112:26379: OK
Migrating testkey76 to 192.168.174.114:26379: OK
Migrating testkey32 to 192.168.174.114:26379: OK
Migrating testkey10 to 192.168.174.114:26379: OK
Migrating testkey3 to 192.168.174.112:26379: OK
Migrating testkey41 to 192.168.174.108:26379: OK
Migrating testkey51 to 192.168.174.112:26379: OK
Migrating testkey99 to 192.168.174.112:26379: OK
Migrating testkey24 to 192.168.174.114:26379: OK
Migrating testkey20 to 192.168.174.114:26379: OK
Migrating testkey25 to 192.168.174.114:26379: OK
Migrating testkey73 to 192.168.174.112:26379: OK
Migrating testkey30 to 192.168.174.112:26379: OK
Migrating testkey49 to 192.168.174.112:26379: OK
Migrating testkey58 to 192.168.174.114:26379: OK
Migrating testkey78 to 192.168.174.108:26379: OK
Migrating testkey19 to 192.168.174.112:26379: OK
Migrating testkey2 to 192.168.174.114:26379: OK
Migrating testkey97 to 192.168.174.108:26379: OK
Migrating testkey45 to 192.168.174.108:26379: OK
Migrating testkey66 to 192.168.174.108:26379: OK
Migrating testkey40 to 192.168.174.108:26379: OK
Migrating testkey27 to 192.168.174.112:26379: OK
Migrating testkey60 to 192.168.174.112:26379: OK
Migrating testkey82 to 192.168.174.112:26379: OK
Migrating testkey18 to 192.168.174.114:26379: OK
Migrating testkey57 to 192.168.174.108:26379: OK
Migrating testkey91 to 192.168.174.112:26379: OK
Migrating testkey86 to 192.168.174.112:26379: OK
Migrating testkey37 to 192.168.174.114:26379: OK
Migrating testkey64 to 192.168.174.112:26379: OK
Migrating testkey85 to 192.168.174.108:26379: OK
Migrating testkey6 to 192.168.174.114:26379: OK
Migrating testkey36 to 192.168.174.114:26379: OK
Migrating testkey55 to 192.168.174.112:26379: OK
Migrating testkey31 to 192.168.174.108:26379: OK
Migrating testkey28 to 192.168.174.114:26379: OK
Migrating testkey90 to 192.168.174.114:26379: OK
Migrating testkey23 to 192.168.174.112:26379: OK
Migrating testkey93 to 192.168.174.108:26379: OK
Migrating testkey14 to 192.168.174.114:26379: OK
Migrating testkey35 to 192.168.174.108:26379: OK
Migrating testkey17 to 192.168.174.108:26379: OK
Migrating testkey67 to 192.168.174.108:26379: OK
Migrating testkey21 to 192.168.174.114:26379: OK
Migrating testkey43 to 192.168.174.114:26379: OK
Migrating testkey88 to 192.168.174.108:26379: OK
Migrating testkey87 to 192.168.174.114:26379: OK
Migrating testkey52 to 192.168.174.112:26379: OK
Migrating testkey29 to 192.168.174.114:26379: OK
Migrating testkey59 to 192.168.174.112:26379: OK
Migrating testkey13 to 192.168.174.108:26379: OK
Migrating testkey75 to 192.168.174.108:26379: OK
Migrating testkey7 to 192.168.174.112:26379: OK
Migrating testkey15 to 192.168.174.114:26379: OK
Migrating testkey63 to 192.168.174.108:26379: OK
Migrating testkey92 to 192.168.174.108:26379: OK
Migrating testkey80 to 192.168.174.108:26379: OK
Migrating testkey69 to 192.168.174.114:26379: OK
Migrating testkey98 to 192.168.174.114:26379: OK
Migrating testkey77 to 192.168.174.112:26379: OK
Migrating testkey95 to 192.168.174.112:26379: OK
Migrating testkey65 to 192.168.174.114:26379: OK
Migrating testkey74 to 192.168.174.108:26379: OK
Migrating testkey83 to 192.168.174.114:26379: OK
Migrating testkey46 to 192.168.174.112:26379: OK
Migrating testkey22 to 192.168.174.108:26379: OK
Migrating testkey72 to 192.168.174.114:26379: OK
Migrating testkey53 to 192.168.174.108:26379: OK
Migrating testkey100 to 192.168.174.112:26379: OK
Migrating testkey89 to 192.168.174.108:26379: OK
Migrating testkey61 to 192.168.174.114:26379: OK
Migrating testkey70 to 192.168.174.108:26379: OK
Migrating testkey48 to 192.168.174.108:26379: OK
Migrating testkey44 to 192.168.174.108:26379: OK
Migrating testkey81 to 192.168.174.108:26379: OK
Migrating testkey71 to 192.168.174.108:26379: OK
Migrating testkey33 to 192.168.174.114:26379: OK
Migrating testkey38 to 192.168.174.112:26379: OK
Migrating testkey47 to 192.168.174.114:26379: OK
Migrating testkey94 to 192.168.174.114:26379: OK
Migrating testkey4 to 192.168.174.112:26379: OK
Migrating testkey39 to 192.168.174.108:26379: OK
Migrating testkey8 to 192.168.174.112:26379: OK
Migrating testkey12 to 192.168.174.112:26379: OK
Migrating testkey16 to 192.168.174.112:26379: OK
Migrating testkey56 to 192.168.174.112:26379: OK
Migrating testkey26 to 192.168.174.108:26379: OK
Migrating testkey9 to 192.168.174.108:26379: OK
Migrating testkey54 to 192.168.174.114:26379: OK
Migrating testkey62 to 192.168.174.108:26379: OK
Migrating testkey1 to 192.168.174.108:26379: OK
Migrating testkey50 to 192.168.174.114:26379: OK
Migrating testkey79 to 192.168.174.108:26379: OK
Migrating testkey34 to 192.168.174.112:26379: OK
验证数据
/usr/local/redis/bin/redis-cli -c -p 26379 keys '*'
还原配置信息
在所有节点上执行。
/usr/local/redis/bin/redis-cli -p 26379 -h 127.0.0.1 config set protected-mode yes
/usr/local/redis/bin/redis-cli -p 26379 -a 123456 --no-auth-warning -h 192.168.174.108 config set requirepass '123456'
参考文档
https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/
标签:OK,redis,192.168,集群,26379,174.108,迁移,Migrating From: https://www.cnblogs.com/wangguishe/p/18631195