Updated SAIO instructions for using a loopback device for storage, and changed rsync config to listen only on localhost

This commit is contained in:
Chuck Thier 2010-09-30 19:43:17 +00:00 committed by Tarmac
commit 77fa8a357b

View File

@ -7,9 +7,7 @@ Instructions for setting up a dev VM
------------------------------------ ------------------------------------
This documents setting up a virtual machine for doing Swift development. The This documents setting up a virtual machine for doing Swift development. The
virtual machine will emulate running a four node Swift cluster. It assumes virtual machine will emulate running a four node Swift cluster.
you're using *VMware Fusion 3* on *Mac OS X Snow Leopard*, but should give a
good idea what to do on other environments.
* Get the *Ubuntu 10.04 LTS (Lucid Lynx)* server image: * Get the *Ubuntu 10.04 LTS (Lucid Lynx)* server image:
@ -17,20 +15,9 @@ good idea what to do on other environments.
- Ubuntu Live/Install: http://cdimage.ubuntu.com/releases/10.04/release/ubuntu-10.04-dvd-amd64.iso (4.1 GB) - 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 - Ubuntu Mirrors: https://launchpad.net/ubuntu/+cdmirrors
* Create guest virtual machine: * Create guest virtual machine from the Ubuntu image (if you are going to use
a separate partition for swift data, be sure to add another device when
#. `Continue without disc` creating the VM)
#. `Use operating system installation disc image file`, pick the .iso
from above.
#. Select `Linux` and `Ubuntu 64-bit`.
#. Fill in the *Linux Easy Install* details.
#. `Customize Settings`, name the image whatever you want
(`SAIO` for instance.)
#. When the `Settings` window comes up, select `Hard Disk`, create an
extra disk (the defaults are fine).
#. Start the virtual machine up and wait for the easy install to
finish.
* As root on guest (you'll have to log in as you, then `sudo su -`): * As root on guest (you'll have to log in as you, then `sudo su -`):
#. `apt-get install python-software-properties` #. `apt-get install python-software-properties`
@ -41,11 +28,22 @@ good idea what to do on other environments.
python-xattr sqlite3 xfsprogs python-webob python-eventlet python-xattr sqlite3 xfsprogs python-webob python-eventlet
python-greenlet python-pastedeploy` python-greenlet python-pastedeploy`
#. Install anything else you want, like screen, ssh, vim, etc. #. Install anything else you want, like screen, ssh, vim, etc.
#. If you would like to use another partition for storage:
#. `fdisk /dev/sdb` (set up a single partition) #. `fdisk /dev/sdb` (set up a single partition)
#. `mkfs.xfs -i size=1024 /dev/sdb1` #. `mkfs.xfs -i size=1024 /dev/sdb1`
#. `mkdir /mnt/sdb1`
#. Edit `/etc/fstab` and add #. Edit `/etc/fstab` and add
`/dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0` `/dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0`
#. If you would like to use a loopback device instead of another partition:
#. `dd if=/dev/zero of=/srv/swift-disk bs=1024 count=0 seek=1000000`
(modify seek to make a larger or smaller partition)
#. `mkfs.xfs -i size=1024 /srv/swift-disk`
#. Edit `/etc/fstab` and add
`/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0`
#. `mkdir /mnt/sdb1`
#. `mount /mnt/sdb1` #. `mount /mnt/sdb1`
#. `mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4 /mnt/sdb1/test` #. `mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4 /mnt/sdb1/test`
#. `chown <your-user-name>:<your-group-name> /mnt/sdb1/*` #. `chown <your-user-name>:<your-group-name> /mnt/sdb1/*`
@ -56,7 +54,7 @@ good idea what to do on other environments.
#. Add to `/etc/rc.local` (before the `exit 0`):: #. Add to `/etc/rc.local` (before the `exit 0`)::
mkdir /var/run/swift mkdir /var/run/swift
chown <your-user-name>:<your-user-name> /var/run/swift chown <your-user-name>:<your-group-name> /var/run/swift
#. Create /etc/rsyncd.conf:: #. Create /etc/rsyncd.conf::
@ -64,7 +62,7 @@ good idea what to do on other environments.
gid = <Your group name> gid = <Your group name>
log file = /var/log/rsyncd.log log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid pid file = /var/run/rsyncd.pid
address = 127.0.0.1
[account6012] [account6012]
max connections = 25 max connections = 25
@ -472,6 +470,11 @@ good idea what to do on other environments.
sudo service rsyslog restart sudo service rsyslog restart
sudo service memcached restart sudo service memcached restart
.. note::
If you are using a loopback device, substitute `/dev/sdb1` above with
`/srv/swift-disk`
#. Create `~/bin/remakerings`:: #. Create `~/bin/remakerings`::
#!/bin/bash #!/bin/bash