Advertisement
Guest User

redis migration test

a guest
May 21st, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. cluster = RedisCluster(nodes)
  2. slotA = 0
  3. slotB = 9999
  4. A = cluster.node_by_slot(slotA)
  5. B = cluster.node_by_slot(slotB)
  6. if A is B:
  7.     raise Exception('A and B are equal')
  8. while True:
  9.     cluster.migrate(slotA, A.id, B.id)
  10.     cluster.migrate(slotB, B.id, A.id)
  11.     A, B = B, A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement