2010-07-12 17:03:45 -05:00
=======================
SAIO - Swift All In One
=======================
2010-10-20 14:29:21 -05:00
---------------------------------------------
2010-10-20 10:32:03 -05:00
Instructions for setting up a development VM
2010-10-20 14:29:21 -05:00
---------------------------------------------
2010-07-12 17:03:45 -05:00
This documents setting up a virtual machine for doing Swift development. The
2010-09-30 11:18:37 -05:00
virtual machine will emulate running a four node Swift cluster.
2010-07-12 17:03:45 -05:00
2010-08-20 20:02:58 -06:00
* Get the *Ubuntu 10.04 LTS (Lucid Lynx)* server image:
- Ubuntu Server ISO: http://releases.ubuntu.com/10.04/ubuntu-10.04.1-server-amd64.iso (682 MB)
- Ubuntu Live/Install: http://cdimage.ubuntu.com/releases/10.04/release/ubuntu-10.04-dvd-amd64.iso (4.1 GB)
- Ubuntu Mirrors: https://launchpad.net/ubuntu/+cdmirrors
2010-10-20 10:32:03 -05:00
* Create guest virtual machine from the Ubuntu image.
2010-11-01 15:04:51 -05:00
Additional information about setting up a Swift development snapshot on other distributions is
available on the wiki at http://wiki.openstack.org/SAIOInstructions.
2010-10-28 17:01:50 -05:00
2010-10-20 14:29:21 -05:00
-----------------------------------------
Installing dependencies and the core code
-----------------------------------------
2010-07-12 17:03:45 -05:00
* As root on guest (you'll have to log in as you, then `sudo su -` ):
2010-07-14 14:37:17 -05:00
#. `apt-get install python-software-properties`
#. `add-apt-repository ppa:swift-core/ppa`
2010-07-12 17:03:45 -05:00
#. `apt-get update`
2010-07-16 00:47:58 -05:00
#. `apt-get install curl gcc bzr memcached python-configobj
python-coverage python-dev python-nose python-setuptools python-simplejson
python-xattr sqlite3 xfsprogs python-webob python-eventlet
2011-01-14 13:49:05 -06:00
python-greenlet python-pastedeploy python-netifaces`
2010-07-12 17:03:45 -05:00
#. Install anything else you want, like screen, ssh, vim, etc.
2010-11-30 12:24:55 -06:00
#. Next, choose either :ref: `partition-section` or :ref: `loopback-section` .
2010-10-20 14:29:21 -05:00
.. _partition-section:
Using a partition for storage
=============================
If you are going to use a separate partition for Swift data, be sure to add another device when
creating the VM, and follow these instructions.
2010-10-20 10:32:03 -05:00
#. `fdisk /dev/sdb` (set up a single partition)
#. `mkfs.xfs -i size=1024 /dev/sdb1`
#. Edit `/etc/fstab` and add
2010-09-30 10:35:10 -05:00
`/dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0`
2010-10-20 10:32:03 -05:00
#. `mkdir /mnt/sdb1`
#. `mount /mnt/sdb1`
2011-01-19 16:05:22 -06:00
#. `mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4`
2010-10-20 10:32:03 -05:00
#. `chown <your-user-name>:<your-group-name> /mnt/sdb1/*`
#. `mkdir /srv`
#. `for x in {1..4}; do ln -s /mnt/sdb1/$x /srv/$x; done`
#. `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`
#. `chown -R <your-user-name>:<your-group-name> /etc/swift /srv/[1-4]/ /var/run/swift` -- **Make sure to include the trailing slash after /srv/[1-4]/**
#. Add to `/etc/rc.local` (before the `exit 0` )::
mkdir /var/run/swift
chown <your-user-name>:<your-group-name> /var/run/swift
2010-11-15 10:51:12 -06:00
#. Next, skip to :ref: `rsync-section` .
2010-09-30 10:35:10 -05:00
2010-10-20 14:29:21 -05:00
.. _loopback-section:
2010-10-20 10:32:03 -05:00
2010-10-20 14:29:21 -05:00
Using a loopback device for storage
===================================
If you want to use a loopback device instead of another partition, follow these instructions.
2010-10-20 10:32:03 -05:00
#. `dd if=/dev/zero of=/srv/swift-disk bs=1024 count=0 seek=1000000`
2010-09-30 12:41:49 -05:00
(modify seek to make a larger or smaller partition)
2010-10-20 10:32:03 -05:00
#. `mkfs.xfs -i size=1024 /srv/swift-disk`
#. Edit `/etc/fstab` and add
2010-09-30 12:41:49 -05:00
`/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0`
2010-07-12 17:03:45 -05:00
#. `mkdir /mnt/sdb1`
#. `mount /mnt/sdb1`
2011-01-19 16:05:22 -06:00
#. `mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4`
2010-07-12 17:03:45 -05:00
#. `chown <your-user-name>:<your-group-name> /mnt/sdb1/*`
2010-07-13 22:24:47 -05:00
#. `mkdir /srv`
2010-07-12 17:03:45 -05:00
#. `for x in {1..4}; do ln -s /mnt/sdb1/$x /srv/$x; done`
#. `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`
2010-07-14 08:11:57 -07:00
#. `chown -R <your-user-name>:<your-group-name> /etc/swift /srv/[1-4]/ /var/run/swift` -- **Make sure to include the trailing slash after /srv/[1-4]/**
2010-07-12 17:03:45 -05:00
#. Add to `/etc/rc.local` (before the `exit 0` )::
mkdir /var/run/swift
2010-09-30 12:41:49 -05:00
chown <your-user-name>:<your-group-name> /var/run/swift
2010-07-12 17:03:45 -05:00
2010-11-15 10:51:12 -06:00
.. _rsync-section:
2010-10-20 10:32:03 -05:00
----------------
2010-10-20 14:29:21 -05:00
Setting up rsync
2010-10-20 10:32:03 -05:00
----------------
2010-07-12 17:03:45 -05:00
#. Create /etc/rsyncd.conf::
uid = <Your user name>
gid = <Your group name>
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
2010-09-30 10:47:57 -05:00
address = 127.0.0.1
2010-07-12 17:03:45 -05:00
[account6012]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/account6012.lock
[account6022]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/account6022.lock
[account6032]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/account6032.lock
[account6042]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/account6042.lock
[container6011]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/container6011.lock
[container6021]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/container6021.lock
[container6031]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/container6031.lock
[container6041]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/container6041.lock
[object6010]
max connections = 25
path = /srv/1/node/
read only = false
lock file = /var/lock/object6010.lock
[object6020]
max connections = 25
path = /srv/2/node/
read only = false
lock file = /var/lock/object6020.lock
[object6030]
max connections = 25
path = /srv/3/node/
read only = false
lock file = /var/lock/object6030.lock
[object6040]
max connections = 25
path = /srv/4/node/
read only = false
lock file = /var/lock/object6040.lock
#. Edit the following line in /etc/default/rsync::
RSYNC_ENABLE=true
#. `service rsync restart`
2011-02-04 14:20:09 -06:00
---------------------------------------------------
Optional: Setting up rsyslog for individual logging
---------------------------------------------------
#. Create /etc/rsyslog.d/10-swift.conf::
2011-02-07 14:45:38 -06:00
# Uncomment the following to have a log containing all logs together
#local1,local2,local3,local4,local5.* /var/log/swift/all.log
local1.*;local1.!notice /var/log/swift/proxy.log
local1.notice /var/log/swift/proxy.error
2011-02-04 14:20:09 -06:00
local1.* ~
2011-02-07 14:45:38 -06:00
local2.*;local2.!notice /var/log/swift/storage1.log
local2.notice /var/log/swift/storage1.error
2011-02-04 14:20:09 -06:00
local2.* ~
2011-02-07 14:45:38 -06:00
local3.*;local3.!notice /var/log/swift/storage2.log
local3.notice /var/log/swift/storage2.error
2011-02-04 14:20:09 -06:00
local3.* ~
2011-02-07 14:45:38 -06:00
local4.*;local4.!notice /var/log/swift/storage3.log
local4.notice /var/log/swift/storage3.error
2011-02-04 14:20:09 -06:00
local4.* ~
2011-02-07 14:45:38 -06:00
local5.*;local5.!notice /var/log/swift/storage4.log
local5.notice /var/log/swift/storage4.error
2011-02-04 14:20:09 -06:00
local5.* ~
#. `mkdir /var/log/swift`
#. `restart rsyslog`
2010-10-20 14:29:21 -05:00
------------------------------------------------
Getting the code and setting up test environment
------------------------------------------------
Sample configuration files are provided with all defaults in line-by-line comments.
Do these commands as you on guest:
2010-07-12 17:03:45 -05:00
#. `mkdir ~/bin`
2010-07-18 18:19:48 -05:00
#. Create `~/.bazaar/bazaar.conf` ::
2010-07-12 17:03:45 -05:00
[DEFAULT]
email = Your Name <your-email-address>
2010-07-13 22:24:47 -05:00
#. If you are using launchpad to get the code or make changes, run
`bzr launchpad-login <launchpad_id>`
2010-07-15 10:27:19 -05:00
#. Create the swift repo with `bzr init-repo swift`
#. Check out your bzr branch of swift, for example:
2010-07-18 18:19:48 -05:00
`cd ~/swift; bzr branch lp:swift trunk`
#. `cd ~/swift/trunk; sudo python setup.py develop`
2010-07-12 17:03:45 -05:00
#. Edit `~/.bashrc` and add to the end::
export SWIFT_TEST_CONFIG_FILE=/etc/swift/func_test.conf
export PATH=${PATH}:~/bin
#. `. ~/.bashrc`
2010-10-20 14:29:21 -05:00
---------------------
Configuring each node
---------------------
Sample configuration files are provided with all defaults in line-by-line comments.
2010-12-01 17:08:49 -08:00
#. If your going to use the DevAuth (the default swift-auth-server), create
`/etc/swift/auth-server.conf` (you can skip this if you're going to use
Swauth)::
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
user = <your-user-name>
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = auth-server
[app:auth-server]
use = egg:swift#auth
default_cluster_url = http://127.0.0.1:8080/v1
2010-09-10 13:40:43 -07:00
# Highly recommended to change this.
super_admin_key = devauth
2010-08-20 02:19:50 +00:00
2010-07-12 17:03:45 -05:00
#. Create `/etc/swift/proxy-server.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
bind_port = 8080
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL1
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
2010-12-01 17:08:49 -08:00
# For DevAuth:
2010-08-24 14:38:36 +00:00
pipeline = healthcheck cache auth proxy-server
2010-12-01 17:08:49 -08:00
# For Swauth:
# pipeline = healthcheck cache swauth proxy-server
2010-08-20 02:19:50 +00:00
2010-08-24 14:38:36 +00:00
[app:proxy-server]
2010-08-20 02:19:50 +00:00
use = egg:swift#proxy
2010-11-29 15:19:29 -08:00
allow_account_management = true
2010-08-20 02:19:50 +00:00
2010-12-01 17:08:49 -08:00
# Only needed for DevAuth
2010-08-20 02:19:50 +00:00
[filter:auth]
use = egg:swift#auth
2010-12-01 17:08:49 -08:00
# Only needed for Swauth
[filter:swauth]
use = egg:swift#swauth
# Highly recommended to change this.
super_admin_key = swauthkey
2010-08-20 02:19:50 +00:00
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:cache]
2010-08-24 14:40:36 +00:00
use = egg:swift#memcache
2010-08-20 02:19:50 +00:00
2010-10-14 15:58:44 -07:00
#. Create `/etc/swift/swift.conf` ::
[swift-hash]
# random unique string that can never change (DO NOT LOSE)
swift_hash_path_suffix = changeme
2010-07-12 17:03:45 -05:00
#. Create `/etc/swift/account-server/1.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/1/node
mount_check = false
bind_port = 6012
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL2
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = account-server
[app:account-server]
use = egg:swift#account
2010-07-12 17:03:45 -05:00
[account-replicator]
vm_test_mode = yes
[account-auditor]
[account-reaper]
#. Create `/etc/swift/account-server/2.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/2/node
mount_check = false
bind_port = 6022
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL3
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = account-server
[app:account-server]
use = egg:swift#account
2010-07-12 17:03:45 -05:00
[account-replicator]
vm_test_mode = yes
[account-auditor]
[account-reaper]
#. Create `/etc/swift/account-server/3.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/3/node
mount_check = false
bind_port = 6032
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL4
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = account-server
[app:account-server]
use = egg:swift#account
2010-07-12 17:03:45 -05:00
[account-replicator]
vm_test_mode = yes
[account-auditor]
[account-reaper]
#. Create `/etc/swift/account-server/4.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/4/node
mount_check = false
bind_port = 6042
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL5
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = account-server
[app:account-server]
use = egg:swift#account
2010-07-12 17:03:45 -05:00
[account-replicator]
vm_test_mode = yes
[account-auditor]
[account-reaper]
#. Create `/etc/swift/container-server/1.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/1/node
mount_check = false
bind_port = 6011
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL2
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = container-server
[app:container-server]
use = egg:swift#container
2010-07-12 17:03:45 -05:00
[container-replicator]
vm_test_mode = yes
[container-updater]
[container-auditor]
#. Create `/etc/swift/container-server/2.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/2/node
mount_check = false
bind_port = 6021
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL3
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = container-server
[app:container-server]
use = egg:swift#container
2010-07-12 17:03:45 -05:00
[container-replicator]
vm_test_mode = yes
[container-updater]
[container-auditor]
#. Create `/etc/swift/container-server/3.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/3/node
mount_check = false
bind_port = 6031
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL4
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = container-server
[app:container-server]
use = egg:swift#container
2010-07-12 17:03:45 -05:00
[container-replicator]
vm_test_mode = yes
[container-updater]
[container-auditor]
#. Create `/etc/swift/container-server/4.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/4/node
mount_check = false
bind_port = 6041
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL5
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = container-server
[app:container-server]
use = egg:swift#container
2010-07-12 17:03:45 -05:00
[container-replicator]
vm_test_mode = yes
[container-updater]
[container-auditor]
#. Create `/etc/swift/object-server/1.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/1/node
mount_check = false
bind_port = 6010
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL2
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = object-server
[app:object-server]
use = egg:swift#object
2010-07-12 17:03:45 -05:00
[object-replicator]
vm_test_mode = yes
[object-updater]
[object-auditor]
#. Create `/etc/swift/object-server/2.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/2/node
mount_check = false
bind_port = 6020
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL3
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = object-server
[app:object-server]
use = egg:swift#object
2010-07-12 17:03:45 -05:00
[object-replicator]
vm_test_mode = yes
[object-updater]
[object-auditor]
#. Create `/etc/swift/object-server/3.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/3/node
mount_check = false
bind_port = 6030
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL4
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = object-server
[app:object-server]
use = egg:swift#object
2010-07-12 17:03:45 -05:00
[object-replicator]
vm_test_mode = yes
[object-updater]
[object-auditor]
#. Create `/etc/swift/object-server/4.conf` ::
2010-08-20 02:19:50 +00:00
[DEFAULT]
2010-07-12 17:03:45 -05:00
devices = /srv/4/node
mount_check = false
bind_port = 6040
user = <your-user-name>
2011-02-04 14:20:09 -06:00
log_facility = LOG_LOCAL5
2010-07-12 17:03:45 -05:00
2010-08-20 02:19:50 +00:00
[pipeline:main]
pipeline = object-server
[app:object-server]
use = egg:swift#object
2010-07-12 17:03:45 -05:00
[object-replicator]
vm_test_mode = yes
[object-updater]
[object-auditor]
2010-10-20 14:29:21 -05:00
------------------------------------
Setting up scripts for running Swift
------------------------------------
2010-07-12 17:03:45 -05:00
2010-10-20 14:29:21 -05:00
#. Create `~/bin/resetswift.` If you are using a loopback device substitute `/dev/sdb1` with `/srv/swift-disk` ::
2010-07-12 17:03:45 -05:00
#!/bin/bash
swift-init all stop
sleep 5
sudo umount /mnt/sdb1
sudo mkfs.xfs -f -i size=1024 /dev/sdb1
sudo mount /mnt/sdb1
2011-01-19 16:05:22 -06:00
sudo mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4
2010-07-12 17:03:45 -05:00
sudo chown <your-user-name>:<your-group-name> /mnt/sdb1/*
mkdir -p /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4
sudo rm -f /var/log/debug /var/log/messages /var/log/rsyncd.log /var/log/syslog
sudo service rsyslog restart
sudo service memcached restart
#. Create `~/bin/remakerings` ::
#!/bin/bash
cd /etc/swift
2010-09-01 21:42:24 -05:00
rm -f *.builder * .ring.gz backups/*.builder backups/* .ring.gz
2010-07-12 17:03:45 -05:00
swift-ring-builder object.builder create 18 3 1
swift-ring-builder object.builder add z1-127.0.0.1:6010/sdb1 1
swift-ring-builder object.builder add z2-127.0.0.1:6020/sdb2 1
swift-ring-builder object.builder add z3-127.0.0.1:6030/sdb3 1
swift-ring-builder object.builder add z4-127.0.0.1:6040/sdb4 1
swift-ring-builder object.builder rebalance
swift-ring-builder container.builder create 18 3 1
swift-ring-builder container.builder add z1-127.0.0.1:6011/sdb1 1
swift-ring-builder container.builder add z2-127.0.0.1:6021/sdb2 1
swift-ring-builder container.builder add z3-127.0.0.1:6031/sdb3 1
swift-ring-builder container.builder add z4-127.0.0.1:6041/sdb4 1
swift-ring-builder container.builder rebalance
swift-ring-builder account.builder create 18 3 1
swift-ring-builder account.builder add z1-127.0.0.1:6012/sdb1 1
swift-ring-builder account.builder add z2-127.0.0.1:6022/sdb2 1
swift-ring-builder account.builder add z3-127.0.0.1:6032/sdb3 1
swift-ring-builder account.builder add z4-127.0.0.1:6042/sdb4 1
swift-ring-builder account.builder rebalance
#. Create `~/bin/startmain` ::
#!/bin/bash
2010-12-01 17:08:49 -08:00
# The auth-server line is only needed for DevAuth:
2010-07-12 17:03:45 -05:00
swift-init auth-server start
swift-init proxy-server start
swift-init account-server start
swift-init container-server start
swift-init object-server start
2010-12-01 17:08:49 -08:00
#. For Swauth (not needed for DevAuth), create `~/bin/recreateaccounts` ::
#!/bin/bash
# Replace devauth with whatever your super_admin key is (recorded in
# /etc/swift/proxy-server.conf).
swauth-prep -K swauthkey
swauth-add-user -K swauthkey -a test tester testing
swauth-add-user -K swauthkey -a test2 tester2 testing2
swauth-add-user -K swauthkey test tester3 testing3
swauth-add-user -K swauthkey -a -r reseller reseller reseller
2010-07-12 17:03:45 -05:00
#. Create `~/bin/startrest` ::
#!/bin/bash
2010-09-10 13:40:43 -07:00
# Replace devauth with whatever your super_admin key is (recorded in
2010-12-01 17:08:49 -08:00
# /etc/swift/auth-server.conf). This swift-auth-recreate-accounts line
# is only needed for DevAuth:
2010-09-10 13:40:43 -07:00
swift-auth-recreate-accounts -K devauth
2010-07-12 17:03:45 -05:00
swift-init object-updater start
swift-init container-updater start
swift-init object-replicator start
swift-init container-replicator start
swift-init account-replicator start
swift-init object-auditor start
swift-init container-auditor start
swift-init account-auditor start
swift-init account-reaper start
#. `chmod +x ~/bin/*`
#. `remakerings`
2010-07-18 18:19:48 -05:00
#. `cd ~/swift/trunk; ./.unittests`
#. `startmain` (The `` Unable to increase file descriptor limit. Running as non-root? `` warnings are expected and ok.)
2010-12-01 17:08:49 -08:00
#. For Swauth: `recreateaccounts`
#. For DevAuth: `swift-auth-add-user -K devauth -a test tester testing` # Replace `` devauth `` with whatever your super_admin key is (recorded in /etc/swift/auth-server.conf).
#. Get an `X-Storage-Url` and `X-Auth-Token` : `` curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://127.0.0.1:11000/v1.0 `` # For Swauth, make the last URL `http://127.0.0.1:8080/auth/v1.0`
2010-07-13 22:24:47 -05:00
#. Check that you can GET account: `` curl -v -H 'X-Auth-Token: <token-from-x-auth-token-above>' <url-from-x-storage-url-above> ``
2010-12-01 17:08:49 -08:00
#. Check that `st` works: `st -A http://127.0.0.1:11000/v1.0 -U test:tester -K testing stat` # For Swauth, make the URL `http://127.0.0.1:8080/auth/v1.0`
#. For DevAuth: `swift-auth-add-user -K devauth -a test2 tester2 testing2` # Replace `` devauth `` with whatever your super_admin key is (recorded in /etc/swift/auth-server.conf).
#. For DevAuth: `swift-auth-add-user -K devauth test tester3 testing3` # Replace `` devauth `` with whatever your super_admin key is (recorded in /etc/swift/auth-server.conf).
#. `cp ~/swift/trunk/test/functional/sample.conf /etc/swift/func_test.conf` # For Swauth, add auth_prefix = /auth/ and change auth_port = 8080.
2010-09-05 19:21:08 -07:00
#. `cd ~/swift/trunk; ./.functests` (Note: functional tests will first delete
2010-09-05 19:53:08 -07:00
everything in the configured accounts.)
2010-09-05 19:21:08 -07:00
#. `cd ~/swift/trunk; ./.probetests` (Note: probe tests will reset your
environment as they call `resetswift` for each test.)
2010-07-13 22:24:47 -05:00
2010-07-14 08:11:57 -07:00
If you plan to work on documentation (and who doesn't?!):
2010-10-20 14:29:21 -05:00
On Ubuntu:
#. `sudo apt-get install python-sphinx` installs Sphinx.
#. `python setup.py build_sphinx` builds the documentation.
2010-07-14 08:11:57 -07:00
2010-10-20 14:29:21 -05:00
On MacOS:
2010-10-20 15:24:59 -05:00
#. `sudo easy_install -U sphinx` installs Sphinx.
2010-10-20 14:29:21 -05:00
#. `python setup.py build_sphinx` builds the documentation.
2010-07-13 22:24:47 -05:00
----------------
Debugging Issues
----------------
If all doesn't go as planned, and tests fail, or you can't auth, or something doesn't work, here are some good starting places to look for issues:
#. Everything is logged in /var/log/syslog, so that is a good first place to
look for errors (most likely python tracebacks).
#. Make sure all of the server processes are running. For the base
functionality, the Proxy, Account, Container, Object and Auth servers
should be running
#. If one of the servers are not running, and no errors are logged to syslog,
it may be useful to try to start the server manually, for example:
2010-07-14 08:11:57 -07:00
`swift-object-server /etc/swift/object-server/1.conf` will start the
2010-07-13 22:24:47 -05:00
object server. If there are problems not showing up in syslog,
then you will likely see the traceback on startup.