From Fedora Project Wiki

Revision as of 13:43, 17 September 2012 by Derekh (talk | contribs) (Created page with "{{QA/Test_Case |description= Swift allows storage devices to be added to a running swift environment. In this test we will add a storage device to the ring file. And verfiy it...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Description

Swift allows storage devices to be added to a running swift environment. In this test we will add a storage device to the ring file. And verfiy it is being utilized

Setup

So its more likely we'll see the effects of adding a device we upload more data to swift

$> cd
$> . /path/to/keystonerc
$> for x in {1..10} ; do swift upload c$x test.data ; done

Create a new loopback storage device (use a physical device if you have access to one)

$> truncate /var/tmp/swift-storage-newdevice --size 5G
$> DEVICE=$(losetup --show -f  /var/tmp/swift-storage-newdevice)
$> mkfs.ext4 -I 1024 $DEVICE
$> mkdir -p /srv/node/newdevice
$> mount -o noatime,nodiratime,nobarrier,user_xattr $DEVICE /srv/node/newdevice
$> chown -R swift:swift /srv/node/newdevice 

How to test

Add the new device to the ring

$> swift-ring-builder /etc/swift/account.builder add z1-127.0.0.1:6002/newdevice 100
$> swift-ring-builder /etc/swift/container.builder add z1-127.0.0.1:6001/newdevice 100
$> swift-ring-builder /etc/swift/object.builder add z1-127.0.0.1:6000/newdevice 100
$> swift-ring-builder /etc/swift/object.builder pretend_min_part_hours_passed
$> swift-ring-builder /etc/swift/account.builder pretend_min_part_hours_passed
$> swift-ring-builder /etc/swift/container.builder pretend_min_part_hours_passed

test for files on the new device (there should be none

$> find /srv/node/newdevice -type f

re-balance the ring file

$> swift-ring-builder /etc/swift/account.builder rebalance
$> swift-ring-builder /etc/swift/container.builder rebalance
$> swift-ring-builder /etc/swift/object.builder rebalance

Expected Results

After a sort wait some files should be moved from the other devices to the new storage device

$> find /srv/node/newdevice -type f