Notes from Installing Swift on Ubuntu 16.04

10 Sep 2016

Here are some notes / scripts I saved from installing Swift from scratch, using chapter 9 of OpenStack Swift.

PLEASE NOTE that this install was on a laptop, so the config is NOT production-oriented.

I created a shell script for each step, and ran those shell scripts in order.

0_INSTALL_PYTHON_DEPS.sh
apt-get install git curl gcc memcached rsync sqlite3 xfsprogs \
	git-core libffi-dev python-setuptools
apt-get install python-coverage python-dev python-nose \
	python-simplejson python-xattr python-eventlet \
	python-greenlet python-pastedeploy python-netifaces \
	python-pip python-dnspython python-mock
apt-get install liberasurecode-dev

### WARNING: Do NOT apt-get this, because it's an older version that
### swift-init proxy will complain about!
pip install pyeclib
1_CREATE_ACCTS_CONS_OBJS.sh
#!/bin/bash

set -u
set -e
set -o pipefail

swift-ring-builder account.builder   create 1 1 1
swift-ring-builder container.builder create 1 1 1
swift-ring-builder object.builder    create 1 1 1
2_ADD_DRIVES.sh
#!/bin/bash

set -u
set -e
set -o pipefail

swift-ring-builder account.builder   add r1z1-127.0.0.1:6202/d1 100
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/d1 100
swift-ring-builder object.builder    add r1z1-127.0.0.1:6200/d1 100
3_CREATE_RINGS.sh
#!/bin/bash

set -u
set -e
set -o pipefail

swift-ring-builder account.builder   rebalance
swift-ring-builder container.builder rebalance
swift-ring-builder object.builder    rebalance
4_TEST_AUTH.sh
#!/bin/bash

set -u
set -e
set -o pipefail

# swift_account:  test
# swift_user:     tester
# swift_password: testing

curl -v -H 'X-Auth-User: test:tester' -H 'X-Auth-Key: testing' http://localhost:8080/auth/v1.0/
5_CREATE_TEST_ACCOUNT.sh
#!/bin/bash

set -u
set -e
set -o pipefail

curl -v -H 'X-Storage-Token: AUTH_tk994daac35ba6441a89d98ba507bb5a9a' \
	http://localhost:8080/v1/AUTH_test
6_CREATE_TEST_CONTAINER.sh
#!/bin/bash

set -u
set -e
set -o pipefail

curl -v -H 'X-Storage-Token: AUTH_tk994daac35ba6441a89d98ba507bb5a9a' \
	-X PUT http://localhost:8080/v1/AUTH_test/test_container