Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2.2.7.1
- Swift Configuration
- There are two methods to configure the storage backend for use by Swift.
- 2.2.7.1.1
- Physical Device (Partition) as a storage
- A physical device is partitioned and used as storage. Assuming there is a secondary disk /dev/sdb :
- sudo fdisk /dev/sdb
- Press m for help; n for new partition; p to view the partition table; w to write changes to disk once you are done. You should now
- have a partiton /dev/sda1.
- 2.2.7.1.2
- Loopback Device (File) as storage
- We create a zero filled file for use as a loopback device for the Swift storage backend. Here we use the disk copy command to
- create a file named swift-disk and allocate a million 1KiB blocks (976.56 MiB) to it. So we have a loopback disk of approximately
- 1GiB. We can increase this size by modifying the seek value.
- sudo dd if=/dev/zero of=/srv/swift-disk bs=1024 count=0 seek=1000000
- We now create an xfs filesystem out of the partition or the loopback device we just created. For the loopback file, doing "file
- swift-disk" will give the details of the device. For the partition details, tune2fs utility can be used with "l" parameter.
- For the physical partition:
- sudo mkfs.xfs -i size=1024 /dev/sdb1
- sudo tune2fs -l /dev/sdb1 |grep -i inode
- For the loopback file:
- sudo mkfs.xfs -i size=1024 /srv/swift-disk
- file /srv/swift-disk
- swift-disk1: SGI XFS filesystem data (blksz 4096, inosz 1024, v2 dirs)
- The storage device we created has to be mounted automatically everytime the system starts. Lets create an arbitrary mountpoint
- /mnt/sdb1.
- sudo mkdir /mnt/sdb1
- Edit /etc/fstab and append the following line:
- For the physical partiton
- /dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0
- If you have a loopback file
- /srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0
- Letβs now mount the storage device and create directories (which would act as storage nodes) and provide appropriate permissions
- and ownerships (user:group format) for them. I have set the ownership to swift:swift for all relevant files.
- sudo mount
- sudo mkdir
- sudo chown
- sudo ln -s
- sudo ln -s
- sudo ln -s
- sudo ln -s
- sudo mkdir
- server
- swift
- sudo chown
- /mnt/sdb1
- /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4
- swift:swift /mnt/sdb1/*
- /mnt/sdb1/1 /srv/1
- /mnt/sdb1/2 /srv/2
- /mnt/sdb1/3 /srv/3
- /mnt/sdb1/4 /srv/4
- -p /etc/swift/object-server /etc/swift/container-server /etc/swift/account- β
- /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4 /var/run/ β
- -R swift:swift /etc/swift /srv/[1-4]/
- Append the following lines to /etc/rc.local just before the "exit 0":
- mkdir /var/run/swift
- chown swift:swift /var/run/swift
Add Comment
Please, Sign In to add comment