fangpenlin / swiftsense

MIT License
17 stars 8 forks source link

Quickly see when a ring is unbalanced #8

Open notmyname opened 11 years ago

notmyname commented 11 years ago

The following makes an unbalanced ring:

#!/bin/bash

swift-ring-builder object.builder create 6 3 0

swift-ring-builder object.builder add r1z1-127.0.0.1:6010/d1 10
swift-ring-builder object.builder add r1z1-127.0.0.1:6020/d2 10
swift-ring-builder object.builder add r1z1-127.0.0.1:6080/d8 10

swift-ring-builder object.builder add r1z2-127.0.0.1:6030/d3 10
swift-ring-builder object.builder add r1z2-127.0.0.1:6040/d4 10
#swift-ring-builder object.builder add r1z2-127.0.0.1:6060/d6 10

swift-ring-builder object.builder add r1z3-127.0.0.1:6070/d7 30

swift-ring-builder object.builder rebalance

swift-ring-builder object.builder add r1z4-127.0.0.1:6090/d9 15
swift-ring-builder object.builder rebalance

swift-ring-builder object.builder add r1z4-127.0.0.1:6100/d10 30

swift-ring-builder object.builder write_ring

Given the ring produced from above, you get something like:

screen shot 2013-10-16 at 3 23 42 pm

A good thing to look at to see potential problems is to compare the relative balance of each zone. I would love to see the bar graph improved to show the balance of zones (maybe stack the per-drive bars?)