Based on Ubuntu 14.04 LTS x86_64
On keystone auth node:
# add swift user
keystone user-create --tenant service --name swift --pass SWIFT-USER-PASSWORD# add swift user in admin rolekeystone user-role-add --user swift --tenant service --role admin # add an entry for swift servicekeystone service-create --name=swift --type=object-store --description="Swift Service" # add an entry for swift endpointkeystone endpoint-create --region RegionOne --service swift --publicurl=http://LOAD-BALANCER-OF-PROXY:8080/v1/AUTH_%\(tenant_id\)s --internalurl=http://LOAD-BALANCER-OF-PROXY:8080/v1/AUTH_%\(tenant_id\)s --adminurl=http://LOAD-BALANCER-OF-PROXY:8080On Swift Storage nodes:
1. using eth0 to connect proxy servers and other storage nodes
2. vi /etc/hosts
# remove or comment the line beginning with 127.0.1.1
192.168.20.30 proxynode1
192.168.20.31 proxynode23. aptitude -y install ntpvi /etc/ntp.confserver 192.168.20.30 perferserver 192.168.20.31restrict 192.168.20.30restrict 192.168.20.31service ntp restart4. aptitude -y install python-mysqldb5. aptitude -y install swift swift-account swift-container swift-object xfsprogs6. RAID on the storage drives is not required and not recommended, use a single partition per drive7. vi /etc/swift/swift.conf
# change (it is shared between Nodes - any words you like)[swift-hash]swift_hash_path_suffix = swift_shared_path swift storage node1:single partition, using fdisk, /dev/sdb --> /dev/sdb1 --> /srv/node/sdb1
/dev/sdc --> /dev/sdc1 --> /srv/node/sdc1
partprobe /dev/sdb /dev/sdc
mkfs.xfs -i size=1024 /dev/sdb1
mkfs.xfs -i size=1024 /dev/sdc1
mkdir -p /srv/node/sdb1; mkdir -p /srv/node/sdc1
echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstabecho "/dev/sdc1 /srv/node/sdc1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstabmount /srv/node/sdb1; mount /srv/node/sdc1chown -R swift:swift /srv/nodevi /etc/swift/account-server.conf
bind_ip =192.168.20.40vi /etc/swift/container-server.conf bind_ip =192.168.20.40vi /etc/swift/object-server.conf bind_ip =192.168.20.40 vi /etc/rsyncd.confuid = swiftgid = swiftlog file = /var/log/rsyncd.logpid file = /var/run/rsyncd.pidaddress = STORAGE_LOCAL_NET_IP # 192.168.20.40[account]max connections = 25path = /srv/node/read only = falselock file = /var/lock/account.lock[container]max connections = 25path = /srv/node/read only = falselock file = /var/lock/container.lock[object]max connections = 25path = /srv/node/read only = falselock file = /var/lock/object.lockvi /etc/default/rsync
RSYNC_ENABLE=trueservice rsync startmkdir -p /var/swift/recon; chown -R swift:swift /var/swift/recon
On Swift Proxy Server:
1. eth0 for management/public/floating (192.168.1.0/24), eth1 for internal/flat (192.168.20.0/24), it's recommended to use seperated nic for management network
2. vi /etc/hosts
# remove or comment the line beginning with 127.0.1.1
192.168.1.10 controller
192.168.1.11 node1192.168.1.30 proxynode1192.168.1.31 proxynode2
3. aptitude -y install ntp
vi /etc/ntp.conf
server 192.168.1.10restrict 192.168.1.10restrict 192.168.20.0 mask 255.255.255.0 nomodify notrap
service ntpd restart4. aptitude -y install python-mysqldb
aptitude -y install swift swift-proxy memcached python-keystoneclient python-swiftclient python-webob
vi /etc/memcached.conf-l 192.168.20.30service memcached restart5. vi /etc/swift/proxy-server.conf [DEFAULT]bind_port = 8080user = swift[pipeline:main]pipeline = healthcheck cache authtoken keystoneauth proxy-server[app:proxy-server]use = egg:swift#proxyallow_account_management = trueaccount_autocreate = true[filter:keystoneauth]use = egg:swift#keystoneauthoperator_roles = Member,admin,swiftoperator[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory# Delaying the auth decision is required to support token-less# usage for anonymous referrers ('.r:*').delay_auth_decision = true# cache directory for signing certificatesigning_dir = /home/swift/keystone-signing# auth_* settings refer to the Keystone serverauth_protocol = httpauth_host = controllerauth_port = 35357# the service tenant and swift username and password created in Keystoneadmin_tenant_name = serviceadmin_user = swiftadmin_password = SWIFT-USER-PASSWORD[filter:cache]use = egg:swift#memcachememcache_servers = 192.168.20.30:11211[filter:catch_errors]use = egg:swift#catch_errors[filter:healthcheck]use = egg:swift#healthcheckmkdir -p /home/swift/keystone-signingchown -R swift:swift /home/swift/keystone-signing6. vi /etc/swift/swift.conf# change (it is shared between Nodes - any words you like)[swift-hash]swift_hash_path_suffix = swift_shared_path7. please check , you should have at least 3 disks for the ring (my thought :))cd /etc/swift
swift-ring-builder account.builder create 8 3 1swift-ring-builder container.builder create 8 3 1swift-ring-builder object.builder create 8 3 1you should run above commands only once, so take care of the part_power value
Notes: check for more info on weight, you can use disk capacity in GB for weight value during first initilization
swift-ring-builder account.builder add r1z1-192.168.20.40:6002/sdb1 25
swift-ring-builder container.builder add r1z1-192.168.20.40:6001/sdb1 25swift-ring-builder object.builder add r1z1-192.168.20.40:6000/sdb1 25swift-ring-builder account.builder add r1z1-192.168.20.40:6002/sdc1 25swift-ring-builder container.builder add r1z1-192.168.20.40:6001/sdc1 25swift-ring-builder object.builder add r1z1-192.168.20.140:6000/sdc1 25swift-ring-builder account.builder add r1z1-192.168.20.40:6002/sdd1 25
swift-ring-builder container.builder add r1z1-192.168.20.40:6001/sdd1 25swift-ring-builder object.builder add r1z1-192.168.20.140:6000/sdd1 25Verify the ring contents for each ring (cd /etc/swift to run below commands):
swift-ring-builder account.builderswift-ring-builder container.builderswift-ring-builder object.builder swift-ring-builder account.builder rebalanceswift-ring-builder container.builder rebalanceswift-ring-builder object.builder rebalancechown -R swift:swift /etc/swiftscp /etc/swift/*.gz 192.168.20.40:/etc/swift/service swift-proxy restart
on swift storage node1
1. chown -R swift:swift /etc/swift
2. for service in swift-object swift-object-replicator swift-object-updater swift-object-auditor swift-container swift-container-replicator swift-container-updater swift-container-auditor swift-account swift-account-replicator swift-account-reaper swift-account-auditor; do
service $service startdoneOn keystone auth node:
swift stat