标签:out dfa pen gre 重启 serve connected master col
单机redis
192.168.41.101:6379
redis集群
192.168.41.101:7000 master 192.168.41.101:7001 master 192.168.41.101:7002 192.168.41.102:7000 master 192.168.41.102:7001 192.168.41.102:7002
[root@blaze bin]# ./redis-cli -c -p 7000
127.0.0.1:7000> cluster nodes
ab6d9f956de325cb4cf001abc31df365a5db5234 192.168.41.102:7001 slave 923c9ea13ec8fc19bed309dfbfad094320e1ca41 0 1560304528263 7 connected
48629733acbb8a580a39403dfac92845d63c97b3 192.168.41.101:7001 master - 0 1560304529768 2 connected 5461-10921
2cec8ac00f760c45d86f7903cefad85ec36704e7 192.168.41.102:7002 slave 923c9ea13ec8fc19bed309dfbfad094320e1ca41 0 1560304531271 7 connected
923c9ea13ec8fc19bed309dfbfad094320e1ca41 192.168.41.101:7000 myself,master - 0 0 7 connected 0-5460
e65b319e83997ed6f5323a26aaccba3f35522cbd 192.168.41.101:7002 slave 923c9ea13ec8fc19bed309dfbfad094320e1ca41 0 1560304532274 7 connected
5c0888d5bcceda2904311cbd5405596217c48105 192.168.41.102:7000 master - 0 1560304530268 4 connected 10922-16383
[root@blaze src]# ./redis-trib.rb check 192.168.41.101:7000
>>> Performing Cluster Check (using node 192.168.41.101:7000)
M: 923c9ea13ec8fc19bed309dfbfad094320e1ca41 192.168.41.101:7000
slots:0-5460 (5461 slots) master
3 additional replica(s)
S: ab6d9f956de325cb4cf001abc31df365a5db5234 192.168.41.102:7001
slots: (0 slots) slave
replicates 923c9ea13ec8fc19bed309dfbfad094320e1ca41
M: 48629733acbb8a580a39403dfac92845d63c97b3 192.168.41.101:7001
slots:5461-10921 (5461 slots) master
0 additional replica(s)
S: 2cec8ac00f760c45d86f7903cefad85ec36704e7 192.168.41.102:7002
slots: (0 slots) slave
replicates 923c9ea13ec8fc19bed309dfbfad094320e1ca41
S: e65b319e83997ed6f5323a26aaccba3f35522cbd 192.168.41.101:7002
slots: (0 slots) slave
replicates 923c9ea13ec8fc19bed309dfbfad094320e1ca41
M: 5c0888d5bcceda2904311cbd5405596217c48105 192.168.41.102:7000
slots:10922-16383 (5462 slots) master
0 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
./redis-trib.rb reshard --from 5c0888d5bcceda2904311cbd5405596217c48105 --to 923c9ea13ec8fc19bed309dfbfad094320e1ca41 --slots 5462 --yes 192.168.41.101:7000
./redis-trib.rb reshard --from 48629733acbb8a580a39403dfac92845d63c97b3 --to 923c9ea13ec8fc19bed309dfbfad094320e1ca41 --slots 5461 --yes 192.168.41.101:7000
>>> Performing Cluster Check (using node 192.168.41.101:7000)
M: 923c9ea13ec8fc19bed309dfbfad094320e1ca41 192.168.41.101:7000
slots:0-16383 (16384 slots) master
3 additional replica(s)
S: ab6d9f956de325cb4cf001abc31df365a5db5234 192.168.41.102:7001
slots: (0 slots) slave
replicates 923c9ea13ec8fc19bed309dfbfad094320e1ca41
M: 48629733acbb8a580a39403dfac92845d63c97b3 192.168.41.101:7001
slots: (0 slots) master
0 additional replica(s)
S: 2cec8ac00f760c45d86f7903cefad85ec36704e7 192.168.41.102:7002
slots: (0 slots) slave
replicates 923c9ea13ec8fc19bed309dfbfad094320e1ca41
S: e65b319e83997ed6f5323a26aaccba3f35522cbd 192.168.41.101:7002
slots: (0 slots) slave
replicates 923c9ea13ec8fc19bed309dfbfad094320e1ca41
M: 5c0888d5bcceda2904311cbd5405596217c48105 192.168.41.102:7000
slots: (0 slots) master
0 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
cp 6379目录/appendonly.aof 7000目录
[root@blaze bin]# ./redis-cli -c -p 7000 shutdown
[root@blaze bin]# ./redis-server ../redis.conf
dbsize
./redis-trib.rb reshard --from 923c9ea13ec8fc19bed309dfbfad094320e1ca41 --to 5c0888d5bcceda2904311cbd5405596217c48105 --slots 5462 --yes 192.168.41.101:7000
./redis-trib.rb reshard --from 923c9ea13ec8fc19bed309dfbfad094320e1ca41 --to 48629733acbb8a580a39403dfac92845d63c97b3 --slots 5461 --yes 192.168.41.101:7000
再次查看集群状态和槽分配。
标签:out dfa pen gre 重启 serve connected master col
原文地址:https://www.cnblogs.com/blazeZzz/p/11007977.html