-
-
Save bloodeagle40234/e2ce7d55e140fdb88ff72a645cf7bcba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from swift.common import ring | |
from collections import defaultdict | |
if __name__ == '__main__': | |
rb = ring.RingBuilder(8, 3, 1) | |
for id, (region, zone) in enumerate(11 * [(0, 0), (1, 10), (1, 11)]): | |
rb.add_dev({'id': id, 'region': region, 'zone': zone, 'weight': 1, | |
'ip': '127.0.0.1', 'port': 10000 + region * 100 + zone, | |
'device': 'sda%d' % id}) | |
rb.rebalance() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment