@@ -3,7 +3,7 @@ SAIO - Swift All In One
3
3
=======================
4
4
5
5
------------------------------------
6
- Instructions for setting up a dev VM
6
+ Instructions for setting up a development VM
7
7
------------------------------------
8
8
9
9
This documents setting up a virtual machine for doing Swift development. The
@@ -15,9 +15,15 @@ virtual machine will emulate running a four node Swift cluster.
15
15
- Ubuntu Live/Install: http://cdimage.ubuntu.com/releases/10.04/release/ubuntu-10.04-dvd-amd64.iso (4.1 GB)
16
16
- Ubuntu Mirrors: https://launchpad.net/ubuntu/+cdmirrors
17
17
18
- * Create guest virtual machine from the Ubuntu image (if you are going to use
19
- a separate partition for swift data, be sure to add another device when
20
- creating the VM)
18
+ * Create guest virtual machine from the Ubuntu image.
19
+
20
+ ----------------
21
+ First scenario: partition for storage
22
+ ----------------
23
+
24
+ If you are going to use a separate partition for swift data, be sure to add another device when
25
+ creating the VM, and follow these instructions.
26
+
21
27
* As root on guest (you'll have to log in as you, then `sudo su - `):
22
28
23
29
#. `apt-get install python-software-properties `
@@ -28,21 +34,47 @@ virtual machine will emulate running a four node Swift cluster.
28
34
python-xattr sqlite3 xfsprogs python-webob python-eventlet
29
35
python-greenlet python-pastedeploy `
30
36
#. Install anything else you want, like screen, ssh, vim, etc.
31
- #. If you would like to use another partition for storage:
32
-
33
- #. `fdisk /dev/sdb ` (set up a single partition)
34
- #. `mkfs.xfs -i size=1024 /dev/sdb1 `
35
- #. Edit `/etc/fstab ` and add
37
+ #. To use another partition for storage:
38
+ #. `fdisk /dev/sdb ` (set up a single partition)
39
+ #. `mkfs.xfs -i size=1024 /dev/sdb1 `
40
+ #. Edit `/etc/fstab ` and add
36
41
`/dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0 `
42
+ #. `mkdir /mnt/sdb1 `
43
+ #. `mount /mnt/sdb1 `
44
+ #. `mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4 /mnt/sdb1/test `
45
+ #. `chown <your-user-name>:<your-group-name> /mnt/sdb1/* `
46
+ #. `mkdir /srv `
47
+ #. `for x in {1..4}; do ln -s /mnt/sdb1/$x /srv/$x; done `
48
+ #. `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 `
49
+ #. `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]/ **
50
+ #. Add to `/etc/rc.local ` (before the `exit 0 `)::
37
51
38
- #. If you would like to use a loopback device instead of another partition:
52
+ mkdir /var/run/swift
53
+ chown <your-user-name>:<your-group-name> /var/run/swift
54
+
55
+ ----------------
56
+ Second scenario: loopback device for storage
57
+ ----------------
39
58
40
- #. `dd if=/dev/zero of=/srv/swift-disk bs=1024 count=0 seek=1000000 `
59
+ If you want to use a loopback device instead of another partition, follow these instructions.
60
+
61
+
62
+ * As root on guest (you'll have to log in as you, then `sudo su - `):
63
+
64
+ #. `apt-get install python-software-properties `
65
+ #. `add-apt-repository ppa:swift-core/ppa `
66
+ #. `apt-get update `
67
+ #. `apt-get install curl gcc bzr memcached python-configobj
68
+ python-coverage python-dev python-nose python-setuptools python-simplejson
69
+ python-xattr sqlite3 xfsprogs python-webob python-eventlet
70
+ python-greenlet python-pastedeploy `
71
+ #. Install anything else you want, like screen, ssh, vim, etc.
72
+ #. To use a loopback device instead of another partition:
73
+ #. `dd if=/dev/zero of=/srv/swift-disk bs=1024 count=0 seek=1000000 `
41
74
(modify seek to make a larger or smaller partition)
42
- #. `mkfs.xfs -i size=1024 /srv/swift-disk `
43
- #. Edit `/etc/fstab ` and add
75
+ #. `mkfs.xfs -i size=1024 /srv/swift-disk `
76
+ #. Edit `/etc/fstab ` and add
44
77
`/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0 `
45
-
46
78
#. `mkdir /mnt/sdb1 `
47
79
#. `mount /mnt/sdb1 `
48
80
#. `mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4 /mnt/sdb1/test `
@@ -56,6 +88,12 @@ virtual machine will emulate running a four node Swift cluster.
56
88
mkdir /var/run/swift
57
89
chown <your-user-name>:<your-group-name> /var/run/swift
58
90
91
+ ----------------
92
+ Configuring each node
93
+ ----------------
94
+
95
+ Sample configuration files are provided with all defaults in line-by-line comments.
96
+
59
97
#. Create /etc/rsyncd.conf::
60
98
61
99
uid = <Your user name>
@@ -461,6 +499,10 @@ virtual machine will emulate running a four node Swift cluster.
461
499
[object-auditor]
462
500
463
501
#. Create `~/bin/resetswift `::
502
+ .. note ::
503
+
504
+ If you are using a loopback device, substitute `/dev/sdb1 ` above with
505
+ `/srv/swift-disk `
464
506
465
507
#!/bin/bash
466
508
@@ -476,11 +518,6 @@ virtual machine will emulate running a four node Swift cluster.
476
518
sudo service rsyslog restart
477
519
sudo service memcached restart
478
520
479
- .. note ::
480
-
481
- If you are using a loopback device, substitute `/dev/sdb1 ` above with
482
- `/srv/swift-disk `
483
-
484
521
#. Create `~/bin/remakerings `::
485
522
486
523
#!/bin/bash
0 commit comments