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
- Sudo useradd-mk/home/swift/-s/bin/bash swift
- Sudo passwd swift # Add a password for a swift user. Here I set it to swift
- Edit the/etc/sudoer file and add the following code at the end of the file:
- Swift ALL = (ALL) NOPASSWD: ALL
4. Download the swift and swauth source code (for swift Users)
- Su swift # Switch to swift user
- Sudo mkdir/home/swift/openstack # create a directory to store
- Cd/home/swift/openstack
- Git clone https://github.com/openstack/swift.git # download swift
- Cd swift
- 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.
- Git clone https://github.com/gholt/swauth.git # download swauth
- Cd swauth
- Git checkout 1.0.4
5. Install swift and swauth (for swift Users)
- Cd/home/swift/openstack/swift
- Sudo python setup. py install -- record file.txt
- # Parameter -- enter the following command in the directory where the record file is located: sudo cat file.txt | xargs rm-rf
-
- Cd/home/swift/openstack/swauth
- Sudo python setup. py install -- record file.txt
6. Install related software
- 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.
- Sudo mkfs. xfs-I size = 1024/dev/sdb1 # format partitions in xfs Mode
- Sudo chmod a + w/etc/fstab
- Sudo echo "/dev/sdb1/mnt/sdb1 xfs noatime, nodiratime nobarrier, logbufs = 8 0 0">/etc/fstab # automatic mounting upon system startup
-
- Sudo mkdir/mnt/sdb1 # create an sdb1 Mount directory under/mnt
- Sudo mount/mnt/sdb1 # mount
-
- Sudo mkdir/mnt/sdb1/1/mnt/sdb1/2/mnt/sdb1/3/mnt/sdb1/4
- Sudo chown swift: swift/mnt/sdb1 /*
- Sudo mkdir/srv
-
- For x in {1 .. 4}; do sudo ln-s/mnt/sdb1/$ x/srv/$ x; done # create a connection
-
- 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
-
- Sudo chown-R swift: swift/etc/swift/srv/[1-4] // var/run/swift
-
- Add the following three lines before exit 0 of/etc/rc. local.
- Mkdir/var/run/swift
- Chown swift: swift/var/run/swift
- 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)
- Sudo mkdir/srv
- 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
- # Store area, you can change the seek size to change the swift-disk size
-
- Sudo mkfs. xfs-I size = 1024/srv/swift-disk
- Sudo chmod a + w/etc/fstab
- Sudo echo "/srv/swift-disk/mnt/sdb1 xfs loop, noatime, nodiratime, nobarrier, logbufs = 80 0">/etc/fstab # system startup
- # Automatic mounting
-
- Sudo mkdir/mnt/sdb1 # create an sdb1 Mount directory under/mnt
- Sudo mount/mnt/sdb1 # mount
-
- Sudo mkdir/mnt/sdb1/1/mnt/sdb1/2/mnt/sdb1/3/mnt/sdb1/4
- Sudo chown swift: swift/mnt/sdb1 /*
-
- For x in {1 .. 4}; do sudo ln-s/mnt/sdb1/$ x/srv/$ x; done # create a connection
-
- 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
-
- Sudo chown-R swift: swift/etc/swift/srv/[1-4] // var/run/swift
-
- Add the following three lines before exit 0 of/etc/rc. local.
- Mkdir/var/run/swift
- Chown swift: swift/var/run/swift
- Chmod a + w/var/run/swift