Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cluster = RedisCluster(nodes)
- slotA = 0
- slotB = 9999
- A = cluster.node_by_slot(slotA)
- B = cluster.node_by_slot(slotB)
- if A is B:
- raise Exception('A and B are equal')
- while True:
- cluster.migrate(slotA, A.id, B.id)
- cluster.migrate(slotB, B.id, A.id)
- A, B = B, A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement