1. Prepare the 1.1 version of Linux: ttuserver12.04.1lts; Swift version: 1.0 (later installed); Python version: 2.7.3 (later installed); Python-swiftclient version: 1.3.0 (later installed ). Summary of Swift multi-node installation and testing in Ubuntu & n
1. Prepare the environment
Version 1.1
Linux: Ubuntu Server 12.04.1 LTS;
Swift version: 1.0 (installed later );
Python version: 2.7.3 (later installation );
Python-swiftclient version: 1.3.0 (installed later ).
Summary of Swift multi-node installation and testing in UbuntuHttp://www.linuxidc.com/Linux/2014-02/97347.htm
1.2 node IP
IP: 192.168.1.107.
1.3 Replace the image (optional)
If the network speed is slow or the software installation fails, consider replacing it with a domestic image:
Vsroot @ ubuntu :~ $ Sudo sed-I's # us.archive.ubuntu.com # mirrors.163.com # G'/etc/apt/sources. list
Vsroot @ ubuntu :~ $ Sudo apt-get update
1.4 system time
Vsroot @ ubuntu :~ $ Date # Check whether the system time is correct. If the system time is correct, ignore the following two steps:
Vsroot @ ubuntu :~ $ Sudo date-s "15:05:57" # set the system time
Vsroot @ ubuntu :~ $ Sudo hwclock-w # hardware write time
1.5 disable Firewall
Make sure SELinux is disabled.
Vsroot @ ubuntu :~ $ Sudo ufw disable # disable Firewall
2. General OS Configuration
2.1 create a Swift user
Vsroot @ ubuntu :~ $ Sudo useradd-mk/home/swift-s/bin/bash swift
Vsroot @ ubuntu :~ $ Sudo passwd swift # Set your swift password to swift
Edit/etc/sudoers and add the following content to the end of the file:
Vsroot @ ubuntu :~ $ Sudo vim/etc/sudoers
# User alias specification
Swift ALL = (ALL) NOPASSWD: ALL
Then you can switch to the swift user for subsequent operations:
Vsroot @ ubuntu :~ $ Su swift
2.2 install the Swift dependency Library
Swift @ ubuntu :~ $ Sudo apt-get install curlgcc memcached rsync sqlite3 xfsprogs git-core libffi-dev python-setuptools
Swift @ ubuntu :~ $ Sudo apt-get installpython-coverage python-dev python-nose python-simplejson python-xattrpython-eventlet python-greenlet python-pastedeploy python-netifaces python-pippython-dnspython python-mock
2.3 install Swift software
Swift @ ubuntu :~ $ Sudo add-apt-repositorycloud-archive: grizzly
Swift @ ubuntu :~ $ Sudo apt-get update
Swift @ ubuntu :~ $ Sudo apt-get install swiftpython-swiftclient openssh-server
2.4 create a working directory for Swift
Swift @ ubuntu :~ $ Sudo mkdir-p/etc/swift
Swift @ ubuntu :~ $ Sudo chown-R swift: swift/etc/swift/
2.5 create a Swift configuration file
Swift @ ubuntu :~ $ Cat>/etc/swift. conf < < p><>
[Swift-hash]
# Random unique strings that can neverchange (do not lose)
Swift_hash_path_prefix = 'od-t x8-N 8-
Swift_hash_path_suffix = 'od-t x8-N 8-
EOF
2.6 set IP environment variables
Set the following according to your actual IP Address:
Swift @ ubuntu :~ $ Export LOCAL_NET_IP = 192.168.1.107
Considering that the export command only takes effect for the current session of the current user, you can also write the environment variable to/etc/profile:
Swift @ ubuntu :~ $ Sudo vim/etc/profile
Swift @ ubuntu :~ $ Source/etc/profile # the current session takes effect immediately
2.7 create a Swift service directory and modify the boot configuration file
Swift @ ubuntu :~ $ Sudo mkdir-p/var/cache/swift/var/cache/swift2/var/cache/swift3/var/cache/swift4
Swift @ ubuntu :~ $ Sudo chown swift: swift/var/cache/swift *
Swift @ ubuntu :~ $ Sudo mkdir-p/var/run/swift
Swift @ ubuntu :~ $ Sudo chown swift: swift/var/run/swift
Swift @ ubuntu :~ $ Sudo vim/etc/rc. local
Sudo mkdir-p/var/cache/swift/var/cache/swift2/var/cache/swift3/var/cache/swift4
Sudo chown swift: swift/var/cache/swift *
Sudo mkdir-p/var/run/swift
Sudo chown swift: swift/var/run/swift
Exit 0
3. Configure the Proxy service
3.1 install the swift-proxy Library
Swift @ ubuntu :~ $ Sudo apt-get installswift-proxy memcached
3.2 configure memcached and listen to the default port
Swift @ ubuntu :~ $ Sudo perl-pi-e "s/-l127.0.0.1/-l $ LOCAL_NET_IP/"/etc/memcached. conf # Replace it with your own IP Address
3.3 restart the memcached Server
Swift @ ubuntu :~ $ Sudo service memcachedrestart
Check whether the memcached service has been started properly.
3.4 create a Proxy server configuration file
Swift @ ubuntu :~ $ Cat>/etc/swift/proxy-server.conf < < p><>
[DEFAULT]
Bind_port = 8080
Workers = 1
User = swift
Log_facility = LOG_LOCAL1
Eventlet_debug = true
[Pipeline: main]
# Yes, proxy-logging appears twice. This isnot a mistake.
Pipeline = healthcheck proxy-logging cachetempauth proxy-logging proxy-server
[App: proxy-server]
Use = egg: swift # proxy
Allow_account_management = true
Account_autocreate = true
[Filter: tempauth]
Use = egg: swift # tempauth
User_admin_admin = admin. admin. reseller_admin
User_test_tester = testing. admin
User_test2_tester2 = testing2. admin
User_test_tester3 = testing3
[Filter: healthcheck]
Use = egg: swift # healthcheck
[Filter: cache]
Use = egg: swift # memcache
Memcache_servers = $ LOCAL_NET_IP: 11211
[Filter: proxy-logging]
Use = egg: swift # proxy_logging
EOF
3.5 ensure that all configuration files belong to swift users
Swift @ ubuntu :~ $ Sudo chown-R swift: swift/etc/swift
Install Swift http://www.linuxidc.com/Linux/2012-04/58100.htm on multiple nodes using Swauth authentication in Ubuntu Server 11.10