Install the Swift component of OpenStack on Ubuntu-installingopenstackobjectstorage

Source: Internet
Author: User
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:

  1. Linux: Ubuntu Server 12.04
  2. Proxy Server IP: 10.214.0.181
  3. Storage Server One: 10.214.0.179
  4. Storage Server Two: 10.214.0.180
  5. 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

  1. 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

  1. Mkdir-p/etc/swift
  2. Chown-R swift: swift/etc/swift/
mkdir -p /etc/swiftchown -R swift:swift /etc/swift/


Create a file vim/etc/swift. conf

  1. [Swift-hash]
  2. # Random unique string that can never change (do not lose)
  3. 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.

  1. 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.

  1. Fdisk/dev/sdb
  2. Command (m for help): n
  3. Partition type:
  4. P primary (0 primary, 0 extended, 4 free)
  5. E extended
  6. Select (default p): p
  7. Partition number (1-4, default 1): 1
  8. First sector (2048-488281249, default 2048 ):
  9. Using default value 2048
  10. Last sector, + sectors or + size {K, M, G} (2048-488281249, default 488281249 ):
  11. Using default value 488281249
  12. Command (m for help): p
  13. Disk/dev/sdb: 250.0 GB, 250000000000 bytes
  14. 255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors
  15. Units = sectors of 1*512 = 512 bytes
  16. Sector size (logical/physical): 512 bytes/512 bytes
  17. I/O size (minimum/optimal): 512 bytes/512 bytes
  18. Disk identifier: 0x00000081
  19. Device Boot Start End Blocks Id System
  20. /Dev/sdb1 2048 488281249 244139601 83 Linux
  21. Command (m for help): w
  22. 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:

  1. Partprobe # If not, restart it.
Partprobe # If not, restart it.
 
  1. Mkdir-p/srv/node/sdb1
mkdir -p /srv/node/sdb1
 
  1. Mkfs. xfs-I size = 1024/dev/sdb1-f
  2. Echo "/dev/sdb1/srv/node/sdb1 xfs noatime, nodiratime, nobarrier, logbufs = 8 0 0">/etc/fstab
  3. 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
 
  1. Chown-R swift: swift/srv/node
chown -R swift:swift /srv/node

Create and configure vim/etc/rsyncd. conf

  1. Uid = swift
  2. Gid = swift
  3. Log file =/var/log/rsyncd. log
  4. Pid file =/var/run/rsyncd. pid
  5. Address = 10.214.0.179
  6. [Account]
  7. Max connections = 2
  8. Path =/srv/node/
  9. Read only = false
  10. Lock file =/var/lock/account. lock
  11. [Container]
  12. Max connections = 2
  13. Path =/srv/node/
  14. Read only = false
  15. Lock file =/var/lock/container. lock
  16. [Object]
  17. Max connections = 2
  18. Path =/srv/node/
  19. Read only = false
  20. 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)

  1. RSYNC_ENABLE = true
RSYNC_ENABLE = true

Restart/start the service

  1. Service rsync restart
service rsync restart


Create or check vim/etc/swift/account-server.conf

  1. [DEFAULT]
  2. Devices =/sdb1
  3. Mount_check = false
  4. Bind_port = 6002
  5. User = swift
  6. Bind_ip = 0.0.0.0
  7. Workers = 2
  8. [Pipeline: main]
  9. Pipeline = account-server
  10. [App: account-server]
  11. Use = egg: swift # account
  12. [Account-replicator]
  13. [Account-auditor]
  14. [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

  1. [DEFAULT]
  2. Devices =/sdb1
  3. Mount_check = false
  4. Bind_ip = 0.0.0.0
  5. Bind_port = 6001
  6. Workers = 2
  7. [Pipeline: main]
  8. Pipeline = container-server
  9. [App: container-server]
  10. Use = egg: swift # container
  11. [Container-replicator]
  12. [Container-updater]
  13. [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]
 
  1. [Container-sync]
[container-sync]
 
    1. Note: [container-sync] is added. Do not forget it.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.