We are building a swift environment on our own these days. After reading some documents and combining my own practices, I wrote it: For more information about the OpenStackHandsonlab series, see workshop.
We are building a swift environment on our own these days. After reading some documents and combining my own practices, I wrote it down:
For more information about the OpenStack Hands on lab series, seeHttp://www.linuxidc.com/Linux/2013-08/88170.htm
Related reading:
OpenStack monitoring-integrated Nagios Research Summary http://www.linuxidc.com/Linux/2013-02/79931.htm
CentOS 6.4 install OpenStack Nova http://www.linuxidc.com/Linux/2013-07/86981.htm
OpenStack HP push Cloud OS Cloud operating system http://www.linuxidc.com/Linux/2013-06/86361.htm
1. Physical Environment Description:
- Linux: Ubuntu Server 12.04
- Proxy Server IP: 10.214.0.181
- Storage Server One: 10.214.0.179
- Storage Server Two: 10.214.0.180
- Storage Server three: 10.214.0.182
Linux: Ubuntu Server 12.04 Proxy Server IP: 10.214.0.181Storage Server One: 10.214.0.179Storage Server Two: 10.214.0.180Storage Server three: 10.214.0.182
2. important components:
Node: runs one or more object storage services.
Proxy node: Run proxy services
Auth node: Run Auth service
Storage: Run account, container, and object services.
Ring: A opening set from Openstack object storage to physical devices.
Preparations on all nodes:
Install services
- Apt-get install swift openssh-server rsync memcached python-netifaces python-xattr python-memcache
apt-get install swift openssh-server rsync memcached python-netifaces python-xattr python-memcache
Configuration path
- Mkdir-p/etc/swift
- Chown-R swift: swift/etc/swift/
mkdir -p /etc/swiftchown -R swift:swift /etc/swift/
Create a file vim/etc/swift. conf
- [Swift-hash]
- # Random unique string that can never change (do not lose)
- Swift_hash_path_suffix = fLIbertYgibbitZ
[swift-hash]# random unique string that can never change (DO NOT LOSE)swift_hash_path_suffix = fLIbertYgibbitZ
3. install and configure storage nodes
Installation: Storage node packages. All storage operations are required.
- Aptitude install swift-account swift-container swift-object xfsprogs
aptitude install swift-account swift-container swift-object xfsprogs
Create an xfs system partition. Of course, (this requires an empty partition). If the partition on the hard disk is used and the data is no longer needed, delete the partition and perform the following operations. Otherwise, adding a new hard disk is the most convenient choice. All storage operations are required.
- Fdisk/dev/sdb
- Command (m for help): n
- Partition type:
- P primary (0 primary, 0 extended, 4 free)
- E extended
- Select (default p): p
- Partition number (1-4, default 1): 1
- First sector (2048-488281249, default 2048 ):
- Using default value 2048
- Last sector, + sectors or + size {K, M, G} (2048-488281249, default 488281249 ):
- Using default value 488281249
- Command (m for help): p
- Disk/dev/sdb: 250.0 GB, 250000000000 bytes
- 255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors
- Units = sectors of 1*512 = 512 bytes
- Sector size (logical/physical): 512 bytes/512 bytes
- I/O size (minimum/optimal): 512 bytes/512 bytes
- Disk identifier: 0x00000081
- Device Boot Start End Blocks Id System
- /Dev/sdb1 2048 488281249 244139601 83 Linux
- Command (m for help): w
- The partition table has been altered!
fdisk /dev/sdb Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-488281249, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-488281249, default 488281249): Using default value 488281249Command (m for help): pDisk /dev/sdb: 250.0 GB, 250000000000 bytes255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000081 Device Boot Start End Blocks Id System/dev/sdb1 2048 488281249 244139601 83 LinuxCommand (m for help): wThe partition table has been altered!
Identify and mount a new partition:
- Partprobe # If not, restart it.
Partprobe # If not, restart it.
- Mkdir-p/srv/node/sdb1
mkdir -p /srv/node/sdb1
- Mkfs. xfs-I size = 1024/dev/sdb1-f
- Echo "/dev/sdb1/srv/node/sdb1 xfs noatime, nodiratime, nobarrier, logbufs = 8 0 0">/etc/fstab
- Mount/srv/node/sdb1
mkfs.xfs -i size=1024 /dev/sdb1 -fecho "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstabmount /srv/node/sdb1
- Chown-R swift: swift/srv/node
chown -R swift:swift /srv/node
Create and configure vim/etc/rsyncd. conf
- Uid = swift
- Gid = swift
- Log file =/var/log/rsyncd. log
- Pid file =/var/run/rsyncd. pid
- Address = 10.214.0.179
- [Account]
- Max connections = 2
- Path =/srv/node/
- Read only = false
- Lock file =/var/lock/account. lock
- [Container]
- Max connections = 2
- Path =/srv/node/
- Read only = false
- Lock file =/var/lock/container. lock
- [Object]
- Max connections = 2
- Path =/srv/node/
- Read only = false
- Lock file =/var/lock/object. lock
uid = swiftgid = swiftlog file = /var/log/rsyncd.logpid file = /var/run/rsyncd.pidaddress = 10.214.0.179[account]max connections = 2path = /srv/node/read only = falselock file = /var/lock/account.lock[container]max connections = 2path =/srv/node/read only = falselock file = /var/lock/container.lock[object]max connections = 2path = /srv/node/read only = falselock file = /var/lock/object.lock
Note: The path writes the location of your actual (just created) partition. Change address to the address of the current storage.
Edit vim/etc/default/rsync (set to start at startup)
- RSYNC_ENABLE = true
RSYNC_ENABLE = true
Restart/start the service
- Service rsync restart
service rsync restart
Create or check vim/etc/swift/account-server.conf
- [DEFAULT]
- Devices =/sdb1
- Mount_check = false
- Bind_port = 6002
- User = swift
- Bind_ip = 0.0.0.0
- Workers = 2
- [Pipeline: main]
- Pipeline = account-server
- [App: account-server]
- Use = egg: swift # account
- [Account-replicator]
- [Account-auditor]
- [Account-reaper]
[DEFAULT]devices = /sdb1mount_check = false bind_port = 6002 user = swiftbind_ip = 0.0.0.0workers = 2[pipeline:main]pipeline = account-server[app:account-server]use = egg:swift#account[account-replicator][account-auditor][account-reaper]
Create or check vim/etc/swift/container-server.conf
- [DEFAULT]
- Devices =/sdb1
- Mount_check = false
- Bind_ip = 0.0.0.0
- Bind_port = 6001
- Workers = 2
- [Pipeline: main]
- Pipeline = container-server
- [App: container-server]
- Use = egg: swift # container
- [Container-replicator]
- [Container-updater]
- [Container-auditor]
[DEFAULT]devices = /sdb1mount_check = falsebind_ip = 0.0.0.0bind_port = 6001workers = 2[pipeline:main]pipeline = container-server[app:container-server]use = egg:swift#container[container-replicator][container-updater][container-auditor]
- [Container-sync]
[container-sync]
- Note: [container-sync] is added. Do not forget it.