Ask Your Question
0

Multiple Server Swift Installation—rebalance

asked 2011-09-06 01:52:29 -0500

linyouqing7 gravatar image

I use four Virtual Machines to set up swift in muitiple Sever. one for proxy&auth node ,and others for storage node.

root@swift-proxy:/etc/swift# ./verify.sh account.builder, build version 3 262144 partitions, 2 replicas, 1 zones, 3 devices, 100.00 balance The minimum number of hours before a partition can be reassigned is 1 Devices: id zone ip address port name weight partitions balance meta 0 5 192.168.1.84 6002 sdb1 100.00 0 -100.00 1 5 192.168.1.82 6002 sdb1 100.00 0 -100.00 2 5 192.168.1.69 6002 sdb1 100.00 0 -100.00 container.builder, build version 3 262144 partitions, 2 replicas, 1 zones, 3 devices, 100.00 balance The minimum number of hours before a partition can be reassigned is 1 Devices: id zone ip address port name weight partitions balance meta 0 5 192.168.1.84 6001 sdb1 100.00 0 -100.00 1 5 192.168.1.82 6001 sdb1 100.00 0 -100.00 2 5 192.168.1.69 6001 sdb1 100.00 0 -100.00 object.builder, build version 3 262144 partitions, 2 replicas, 1 zones, 3 devices, 100.00 balance The minimum number of hours before a partition can be reassigned is 1 Devices: id zone ip address port name weight partitions balance meta 0 5 192.168.1.84 6000 sdb1 100.00 0 -100.00 1 5 192.168.1.82 6000 sdb1 100.00 0 -100.00 2 5 192.168.1.69 6000 sdb1 100.00 0 -100.00

but

root@swift-proxy:/etc/swift# ./rebalance.sh Traceback (most recent call last): File "/usr/bin/swift-ring-builder", line 651, in <module> Commands.__dict__.get(command, Commands.unknown)() File "/usr/bin/swift-ring-builder", line 512, in rebalance parts, balance = builder.rebalance() File "/usr/lib/pymodules/python2.7/swift/common/ring/builder.py", line 243, in rebalance self._initial_balance() File "/usr/lib/pymodules/python2.7/swift/common/ring/builder.py", line 403, in _initial_balance while available_devs[index]['zone'] in other_zones: IndexError: list index out of range Traceback (most recent call last): File "/usr/bin/swift-ring-builder", line 651, in <module> Commands.__dict__.get(command, Commands.unknown)() File "/usr/bin/swift-ring-builder", line 512, in rebalance parts, balance = builder.rebalance() File "/usr/lib/pymodules/python2.7/swift/common/ring/builder.py", line 243, in rebalance self._initial_balance() File "/usr/lib/pymodules/python2.7/swift/common/ring/builder.py", line 403, in _initial_balance while available_devs[index]['zone'] in other_zones: IndexError: list index out of range Traceback (most recent call last): File "/usr/bin/swift-ring-builder", line 651, in <module> Commands.__dict__.get(command, Commands.unknown)() File "/usr/bin/swift-ring-builder", line 512, in rebalance parts, balance = builder.rebalance() File "/usr/lib/pymodules/python2.7/swift/common/ring/builder.py", line 243, in rebalance self._initial_balance() File "/usr/lib/pymodules/python2.7/swift/common/ring/builder.py", line 403, in _initial_balance while available_devs[index]['zone'] in other_zones: IndexError: list index out of range

root@swift-proxy:/etc ... (more)

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2011-09-06 02:11:02 -0500

I have had this problem a few weeks ago

         0 5 192.168.1.84 6002 sdb1 100.00 0 -100.00
         1 5 192.168.1.82 6002 sdb1 100.00 0 -100.00
         2 5 192.168.1.69 6002 sdb1 100.00 0 -100.00

Try creating you nodes with incremental numbers instead of 5 try 1 2 3 Assuming you have a test system delete you /etc/swift/account.builder , Container.builder and object.builder and then recreate

         0 1 192.168.1.84 6002 sdb1 100.00 0 -100.00
         1 2 192.168.1.82 6002 sdb1 100.00 0 -100.00
         2 3 192.168.1.69 6002 sdb1 100.00 0 -100.00

cd /etc/swift swift-ring-builder account.builder create 18 3 1 swift-ring-builder container.builder create 18 3 1 swift-ring-builder object.builder create 18 3 1

export ZONE=1
export STORAGE_LOCAL_NET_IP=192.168.1.84 export WEIGHT=100 export DEVICE=sdb1 swift-ring-builder account.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE $WEIGHT swift-ring-builder container.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6001/$DEVICE $WEIGHT swift-ring-builder object.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6000/$DEVICE $WEIGHT export ZONE=2
export STORAGE_LOCAL_NET_IP= 192.168.1.82 export WEIGHT=100 export DEVICE=sdb1 swift-ring-builder account.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE $WEIGHT swift-ring-builder container.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6001/$DEVICE $WEIGHT swift-ring-builder object.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6000/$DEVICE $WEIGHT export ZONE=3
export STORAGE_LOCAL_NET_IP=192.168.1.69 export WEIGHT=100 export DEVICE=sdb1 swift-ring-builder account.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE $WEIGHT swift-ring-builder container.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6001/$DEVICE $WEIGHT swift-ring-builder object.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6000/$DEVICE $WEIGHT

then do swift-ring-builder account.builder rebalance swift-ring-builder container.builder rebalance swift-ring-builder object.builder rebalance

this should then create the ring.gz files you will then need to then copy the .gz files and the swift.conf over to all storage nodes

Hope that helps

Cheers Phil

edit flag offensive delete link more
0

answered 2011-09-06 03:27:17 -0500

linyouqing7 gravatar image

Phil Rogers Thank you very much !!! "Try creating you nodes with incremental numbersinstead of 5 try 1 2 3" This solved my problem

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-09-06 01:52:29 -0500

Seen: 70 times

Last updated: Sep 06 '11