Deploy SWIFT storage and Swauth authentication in ipvtuserver11.10

Source: Internet
Author: User
1. Summary for more information about Ubuntu, see Ubuntu topics page http://www.linuxidc.com/topicnews.aspx? Tid = 2 all operations involved in this article are verified on the effectuserver11.1064-bit system. This article references the SAIO (SwiftAllInOne) Document of Openstackswift. The details are as follows: Linux version: Ub

1. Summary

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

All operations involved in this article are verified on the 64-bit Ubuntu Server 11.10 system. This document references the SAIO (Swift All In One) Document of Openstackswift. The details are as follows:

Linux: Ubuntu Server11.10 64-bit oneiric

Machine System IP Address: 192.168.112.129

Official documentation: www.openstack.org

Reference: http://swift.openstack.org/development_saio.html

Swift version: 1.4.8

Swauth version: 1.0.4

2. Install the dependency package

Sudo apt-get -- option Dpkg: Options: = -- force-confold -- assume-yes update

Sudo apt-get install pep8 pylint python-pip screen unzip wget psmisc git-core lsofopenssh-server vim-nox locate python-virtualenv python-unittest2 iputils-pingwget curl tcpdump euca2ools python-setuptools python-dev python-lxmlpython-pastescript python-pastedeploy python-paste sqlite3 python-pysqlite2python-sqlalchemy python-mysqldb python-webob python-greenlet python-routeslibldap2-dev python-bcrypt curl gcc python-configobjpython-coverage python-dev python-eventlet python-greenlet python-netifacespython-nose python-pastedeploy python-setuptools python-simplejson python-webobpython-xattr sqlite3 xfsprogs

3. Create a swift user

  1. Sudo useradd-mk/home/swift/-s/bin/bash swift
  2. Sudo passwd swift # Add a password for a swift user. Here I set it to swift
  3. Edit the/etc/sudoer file and add the following code at the end of the file:
  4. Swift ALL = (ALL) NOPASSWD: ALL

4. Download the swift and swauth source code (for swift Users)

  1. Su swift # Switch to swift user
  2. Sudo mkdir/home/swift/openstack # create a directory to store
  3. Cd/home/swift/openstack
  4. Git clone https://github.com/openstack/swift.git # download swift
  5. Cd swift
  6. Git checkout 1.4.8 # Use version 1.4.8. In the swift directory, you can run the git tag command to check the number of versions.
  7. Git clone https://github.com/gholt/swauth.git # download swauth
  8. Cd swauth
  9. Git checkout 1.0.4

5. Install swift and swauth (for swift Users)

  1. Cd/home/swift/openstack/swift
  2. Sudo python setup. py install -- record file.txt
  3. # Parameter -- enter the following command in the directory where the record file is located: sudo cat file.txt | xargs rm-rf
  4. Cd/home/swift/openstack/swauth
  5. Sudo python setup. py install -- record file.txt

6. Install related software

  1. Sudo apt-get install memcached

7. storage point settings (for swift Users)

There are two ways to set the storage point.

1. there is a separate partition in your system. Use this partition for storage. Here we assume there is/dev/sdb1 in the system (Note: This depends on your system) this partition is not used. We use it for storage.

  1. Sudo mkfs. xfs-I size = 1024/dev/sdb1 # format partitions in xfs Mode
  2. Sudo chmod a + w/etc/fstab
  3. Sudo echo "/dev/sdb1/mnt/sdb1 xfs noatime, nodiratime nobarrier, logbufs = 8 0 0">/etc/fstab # automatic mounting upon system startup
  4. Sudo mkdir/mnt/sdb1 # create an sdb1 Mount directory under/mnt
  5. Sudo mount/mnt/sdb1 # mount
  6. Sudo mkdir/mnt/sdb1/1/mnt/sdb1/2/mnt/sdb1/3/mnt/sdb1/4
  7. Sudo chown swift: swift/mnt/sdb1 /*
  8. Sudo mkdir/srv
  9. For x in {1 .. 4}; do sudo ln-s/mnt/sdb1/$ x/srv/$ x; done # create a connection
  10. Sudo mkdir-p/etc/swift/object-server/etc/swift/container-server/etc/swift/account-server/srv/1/node/sdb1/srv/2 /node/sdb2/srv/3/node/sdb3/srv/4/node/sdb4/var/run/swift # create related directories
  11. Sudo chown-R swift: swift/etc/swift/srv/[1-4] // var/run/swift
  12. Add the following three lines before exit 0 of/etc/rc. local.
  13. Mkdir/var/run/swift
  14. Chown swift: swift/var/run/swift
  15. Chmod a + w/var/run/swift

2. If there is no unused partition in the system, you can create a loopback device for storage (here I am using this method)

  1. Sudo mkdir/srv
  2. Sudo dd if =/dev/zero of =/srv/swift-disk bs = 1024 count = 0 seek = 1000000 # This command creates a swift-disk name under/srv /. storage
  3. # Store area, you can change the seek size to change the swift-disk size
  4. Sudo mkfs. xfs-I size = 1024/srv/swift-disk
  5. Sudo chmod a + w/etc/fstab
  6. Sudo echo "/srv/swift-disk/mnt/sdb1 xfs loop, noatime, nodiratime, nobarrier, logbufs = 80 0">/etc/fstab # system startup
  7. # Automatic mounting
  8. Sudo mkdir/mnt/sdb1 # create an sdb1 Mount directory under/mnt
  9. Sudo mount/mnt/sdb1 # mount
  10. Sudo mkdir/mnt/sdb1/1/mnt/sdb1/2/mnt/sdb1/3/mnt/sdb1/4
  11. Sudo chown swift: swift/mnt/sdb1 /*
  12. For x in {1 .. 4}; do sudo ln-s/mnt/sdb1/$ x/srv/$ x; done # create a connection
  13. Sudo mkdir-p/etc/swift/object-server/etc/swift/container-server/etc/swift/account-server/srv/1/node/sdb1/srv/2 /node/sdb2/srv/3/node/sdb3/srv/4/node/sdb4/var/run/swift # create related directories
  14. Sudo chown-R swift: swift/etc/swift/srv/[1-4] // var/run/swift
  15. Add the following three lines before exit 0 of/etc/rc. local.
  16. Mkdir/var/run/swift
  17. Chown swift: swift/var/run/swift
  18. Chmod a + w/var/run/swift
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.