From Fedora Project Wiki

(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...")
 
No edit summary
 
Line 11: Line 11:
Create a new loopback storage device (use a physical device if you have access to one)
Create a new loopback storage device (use a physical device if you have access to one)
  $> truncate /var/tmp/swift-storage-newdevice --size 5G
  $> truncate /var/tmp/swift-storage-newdevice --size 5G
  $> DEVICE=$(losetup --show -f  /var/tmp/swift-storage-newdevice)
  $> DEVICE=$(sudo losetup --show -f  /var/tmp/swift-storage-newdevice)
  $> mkfs.ext4 -I 1024 $DEVICE
  $> sudo mkfs.ext4 -I 1024 $DEVICE
  $> mkdir -p /srv/node/newdevice
  $> sudo mkdir -p /srv/node/newdevice
  $> mount -o noatime,nodiratime,nobarrier,user_xattr $DEVICE /srv/node/newdevice
  $> sudo mount -o noatime,nodiratime,nobarrier,user_xattr $DEVICE /srv/node/newdevice
  $> chown -R swift:swift /srv/node/newdevice
  $> sudo chown -R swift:swift /srv/node/newdevice


|actions=
|actions=
Add the new device to the ring
Add the new device to the ring
  $> swift-ring-builder /etc/swift/account.builder add z1-127.0.0.1:6002/newdevice 100
  $> sudo 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
  $> sudo 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
  $> sudo 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
  $> sudo swift-ring-builder /etc/swift/object.builder pretend_min_part_hours_passed
  $> swift-ring-builder /etc/swift/account.builder pretend_min_part_hours_passed
  $> sudo swift-ring-builder /etc/swift/account.builder pretend_min_part_hours_passed
  $> swift-ring-builder /etc/swift/container.builder pretend_min_part_hours_passed
  $> sudo swift-ring-builder /etc/swift/container.builder pretend_min_part_hours_passed


test for files on the new device (there should be none
test for files on the new device (there should be none
  $> find /srv/node/newdevice -type f
  $> sudo find /srv/node/newdevice -type f


re-balance the ring file
re-balance the ring file
  $> swift-ring-builder /etc/swift/account.builder rebalance
  $> sudo swift-ring-builder /etc/swift/account.builder rebalance
  $> swift-ring-builder /etc/swift/container.builder rebalance
  $> sudo swift-ring-builder /etc/swift/container.builder rebalance
  $> swift-ring-builder /etc/swift/object.builder rebalance
  $> sudo swift-ring-builder /etc/swift/object.builder rebalance


|results=
|results=
After a sort wait some files should be moved from the other devices to the new storage device
After a sort wait some files should be moved from the other devices to the new storage device
  $> find /srv/node/newdevice -type f
  $> sudo find /srv/node/newdevice -type f


}}
}}

Latest revision as of 15:18, 18 September 2012

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=$(sudo losetup --show -f  /var/tmp/swift-storage-newdevice)
$> sudo mkfs.ext4 -I 1024 $DEVICE
$> sudo mkdir -p /srv/node/newdevice
$> sudo mount -o noatime,nodiratime,nobarrier,user_xattr $DEVICE /srv/node/newdevice
$> sudo chown -R swift:swift /srv/node/newdevice 

How to test

Add the new device to the ring

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

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

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

re-balance the ring file

$> sudo swift-ring-builder /etc/swift/account.builder rebalance
$> sudo swift-ring-builder /etc/swift/container.builder rebalance
$> sudo 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

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