Merge lp:~annegentle/swift/lp700894 into lp:~hudson-openstack/swift/trunk

Proposed by Anne Gentle
Status: Merged
Approved by: gholt
Approved revision: 235
Merged at revision: 236
Proposed branch: lp:~annegentle/swift/lp700894
Merge into: lp:~hudson-openstack/swift/trunk
Diff against target: 297 lines (+104/-40)
1 file modified
doc/source/howto_installmultinode.rst (+104/-40)
To merge this branch: bzr merge lp:~annegentle/swift/lp700894
Reviewer Review Type Date Requested Status
gholt (community) Approve
Review via email: mp+52266@code.launchpad.net

Description of the change

Modifying the multi-node install to fix a bug reported (700894) and to put in changes based on feedback from Russell Nelson.

To post a comment you must log in.
Revision history for this message
gholt (gholt) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/source/howto_installmultinode.rst'
2--- doc/source/howto_installmultinode.rst 2011-01-17 21:49:48 +0000
3+++ doc/source/howto_installmultinode.rst 2011-03-04 22:39:10 +0000
4@@ -56,6 +56,9 @@
5
6 This document refers to two networks. An external network for connecting to the Proxy server, and a storage network that is not accessibile from outside the cluster, to which all of the nodes are connected. All of the Swift services, as well as the rsync daemon on the Storage nodes are configured to listen on their STORAGE_LOCAL_NET IP addresses.
7
8+.. note::
9+ Run all commands as the root user
10+
11 General OS configuration and partitioning for each node
12 -------------------------------------------------------
13
14@@ -73,16 +76,27 @@
15 mkdir -p /etc/swift
16 chown -R swift:swift /etc/swift/
17
18-#. Create /etc/swift/swift.conf::
19+#. On the first node only, create /etc/swift/swift.conf::
20
21+ cat >/etc/swift/swift.conf <<EOF
22 [swift-hash]
23 # random unique string that can never change (DO NOT LOSE)
24- swift_hash_path_suffix = changeme
25+ swift_hash_path_suffix = `od -t x8 -N 8 -A n </dev/random`
26+ EOF
27+
28+#. On the second and subsequent nodes: Copy that file over. It must be the same on every node in the cluster!::
29+
30+ scp firstnode.example.com:/etc/swift/swift.conf /etc/swift/
31+
32+#. Publish the local network IP address for use by scripts found later in this documentation::
33+
34+ export STORAGE_LOCAL_NET_IP=10.1.2.3
35+ export PROXY_LOCAL_NET_IP=10.1.2.4
36+ export AUTH_LOCAL_NET_IP=10.1.2.5
37
38 .. note::
39- /etc/swift/swift.conf should be set to some random string of text to be
40- used as a salt when hashing to determine mappings in the ring. This
41- file should be the same on every node in the cluster!
42+ The random string of text in /etc/swift/swift.conf is
43+ used as a salt when hashing to determine mappings in the ring.
44
45 .. _config-proxy:
46
47@@ -101,11 +115,13 @@
48 cd /etc/swift
49 openssl req -new -x509 -nodes -out cert.crt -keyout cert.key
50
51-#. Modify memcached to listen on the default interfaces. Preferably this should be on a local, non-public network. Edit the following line in /etc/memcached.conf, changing::
52-
53- -l 127.0.0.1
54- to
55- -l <PROXY_LOCAL_NET_IP>
56+.. note::
57+ If you don't create the cert files, Swift silently uses http internally rather than https. This document assumes that you have created
58+ these certs, so if you're following along step-by-step, create them.
59+
60+#. Modify memcached to listen on the default interfaces. Preferably this should be on a local, non-public network. Edit the IP address in /etc/memcached.conf, for example::
61+
62+ perl -pi -e "s/-l 127.0.0.1/-l $PROXY_LOCAL_NET_IP/" /etc/memcached.conf
63
64 #. Restart the memcached server::
65
66@@ -113,12 +129,16 @@
67
68 #. Create /etc/swift/proxy-server.conf::
69
70+ cat >/etc/swift/proxy-server.conf <<EOF
71 [DEFAULT]
72 cert_file = /etc/swift/cert.crt
73 key_file = /etc/swift/cert.key
74 bind_port = 8080
75 workers = 8
76 user = swift
77+ # For non-local Auth server
78+ ip = $AUTH_LOCAL_NET_IP
79+
80
81 [pipeline:main]
82 # For DevAuth:
83@@ -138,7 +158,7 @@
84 # Only needed for Swauth
85 [filter:swauth]
86 use = egg:swift#swauth
87- default_swift_cluster = local#https://<PROXY_LOCAL_NET_IP>:8080/v1
88+ default_swift_cluster = local#https://$PROXY_LOCAL_NET_IP:8080/v1
89 # Highly recommended to change this key to something else!
90 super_admin_key = swauthkey
91
92@@ -148,6 +168,7 @@
93 [filter:cache]
94 use = egg:swift#memcache
95 memcache_servers = <PROXY_LOCAL_NET_IP>:11211
96+ EOF
97
98 .. note::
99
100@@ -166,11 +187,15 @@
101
102 For more information on building rings, see :doc:`overview_ring`.
103
104-#. For every storage device on each node add entries to each ring::
105+#. For every storage device in /srv/node on each node add entries to each ring::
106
107- swift-ring-builder account.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP>:6002/<DEVICE> 100
108- swift-ring-builder container.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP_1>:6001/<DEVICE> 100
109- swift-ring-builder object.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP_1>:6000/<DEVICE> 100
110+ export ZONE= # set the zone number for that storage device
111+ export STORAGE_LOCAL_NET_IP= # and the IP address
112+ export WEIGHT=100 # relative weight (higher for bigger/faster disks)
113+ export DEVICE=sdb1
114+ swift-ring-builder account.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE $WEIGHT
115+ swift-ring-builder container.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6001/$DEVICE $WEIGHT
116+ swift-ring-builder object.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6000/$DEVICE $WEIGHT
117
118 .. note::
119 Assuming there are 5 zones with 1 node per zone, ZONE should start at
120@@ -217,6 +242,7 @@
121
122 #. Create /etc/swift/auth-server.conf::
123
124+ cat >/etc/swift/auth-server.conf <<EOF
125 [DEFAULT]
126 cert_file = /etc/swift/cert.crt
127 key_file = /etc/swift/cert.key
128@@ -230,7 +256,8 @@
129 default_cluster_url = https://<PROXY_HOSTNAME>:8080/v1
130 # Highly recommended to change this key to something else!
131 super_admin_key = devauth
132-
133+ EOF
134+
135 #. Start Auth services::
136
137 swift-init auth start
138@@ -242,10 +269,11 @@
139
140 .. note::
141 Swift *should* work on any modern filesystem that supports
142- Extended Attributes (XATTRS). We currently recommend XFS as it
143+ Extended Attributes (XATTRS). We currently recommend XFS as it
144 demonstrated the best overall performance for the swift use case after
145- considerable testing and benchmarking at Rackspace. It is also the
146- only filesystem that has been thoroughly tested.
147+ considerable testing and benchmarking at Rackspace. It is also the
148+ only filesystem that has been thoroughly tested. These instructions
149+ assume that you are going to devote /dev/sdb1 to an XFS filesystem.
150
151 #. Install Storage node packages::
152
153@@ -263,11 +291,12 @@
154
155 #. Create /etc/rsyncd.conf::
156
157+ cat >/etc/rsyncd.conf <<EOF
158 uid = swift
159 gid = swift
160 log file = /var/log/rsyncd.log
161 pid file = /var/run/rsyncd.pid
162- address = <STORAGE_LOCAL_NET_IP>
163+ address = $STORAGE_LOCAL_NET_IP
164
165 [account]
166 max connections = 2
167@@ -286,10 +315,11 @@
168 path = /srv/node/
169 read only = false
170 lock file = /var/lock/object.lock
171-
172-#. Edit the following line in /etc/default/rsync::
173-
174- RSYNC_ENABLE=true
175+ EOF
176+
177+#. Edit the RSYNC_ENABLE= line in /etc/default/rsync::
178+
179+ perl -pi -e 's/RSYNC_ENABLE=false/RSYNC_ENABLE=true/' /etc/default/rsync
180
181 #. Start rsync daemon::
182
183@@ -301,8 +331,9 @@
184
185 #. Create /etc/swift/account-server.conf::
186
187+ cat >/etc/swift/account-server.conf <<EOF
188 [DEFAULT]
189- bind_ip = <STORAGE_LOCAL_NET_IP>
190+ bind_ip = $STORAGE_LOCAL_NET_IP
191 workers = 2
192
193 [pipeline:main]
194@@ -316,9 +347,11 @@
195 [account-auditor]
196
197 [account-reaper]
198+ EOF
199
200 #. Create /etc/swift/container-server.conf::
201
202+ cat >/etc/swift/container-server.conf <<EOF
203 [DEFAULT]
204 bind_ip = <STORAGE_LOCAL_NET_IP>
205 workers = 2
206@@ -334,9 +367,11 @@
207 [container-updater]
208
209 [container-auditor]
210+ EOF
211
212 #. Create /etc/swift/object-server.conf::
213
214+ cat >/etc/swift/object-server.conf <<EOF
215 [DEFAULT]
216 bind_ip = <STORAGE_LOCAL_NET_IP>
217 workers = 2
218@@ -352,20 +387,33 @@
219 [object-updater]
220
221 [object-auditor]
222-
223-#. Start the storage services::
224-
225- swift-init object-server start
226- swift-init object-replicator start
227- swift-init object-updater start
228- swift-init object-auditor start
229- swift-init container-server start
230- swift-init container-replicator start
231- swift-init container-updater start
232- swift-init container-auditor start
233- swift-init account-server start
234- swift-init account-replicator start
235- swift-init account-auditor start
236+ EOF
237+
238+#. Start the storage services. If you use this command, it will try to start every
239+service for which a configuration file exists, and throw a warning for any
240+configuration files which don't exist::
241+
242+ swift-init all start
243+
244+Or, if you want to start them one at a time, run them as below. Note that if the
245+server program in question generates any output on its stdout or stderr, swift-init
246+has already redirected the command's output to /dev/null. If you encounter any
247+difficulty, stop the server and run it by hand from the command line. Any server
248+may be started using "swift-$SERVER-$SERVICE /etc/swift/$SERVER-config", where
249+$SERVER might be object, continer, or account, and $SERVICE might be server,
250+replicator, updater, or auditor.::
251+
252+ swift-init object-server start
253+ swift-init object-replicator start
254+ swift-init object-updater start
255+ swift-init object-auditor start
256+ swift-init container-server start
257+ swift-init container-replicator start
258+ swift-init container-updater start
259+ swift-init container-auditor start
260+ swift-init account-server start
261+ swift-init account-replicator start
262+ swift-init account-auditor start
263
264 Create Swift admin account and test
265 -----------------------------------
266@@ -395,7 +443,7 @@
267
268 curl -k -v -H 'X-Auth-Token: <token-from-x-auth-token-above>' <url-from-x-storage-url-above>
269
270-#. Check that ``st`` works::
271+#. Check that ``st`` works (at this point, expect zero containers, zero objects, and zero bytes)::
272
273 st -A https://<AUTH_HOSTNAME>:11000/v1.0 -U system:root -K testpass stat
274
275@@ -408,6 +456,22 @@
276
277 st -A https://<AUTH_HOSTNAME>:11000/v1.0 -U system:root -K testpass download myfiles
278
279+#. Use ``st`` to save a backup of your builder files to a container named 'builders'. Very important not to lose your builders!::
280+
281+ st -A https://<AUTH_HOSTNAME>:11000/v1.0 -U system:root -K testpass upload builders /etc/swift/*.builder
282+
283+#. Use ``st`` to list your containers::
284+
285+ st -A https://<AUTH_HOSTNAME>:11000/v1.0 -U system:root -K testpass list
286+
287+#. Use ``st`` to list the contents of your 'builders' container::
288+
289+ st -A https://<AUTH_HOSTNAME>:11000/v1.0 -U system:root -K testpass list builders
290+
291+#. Use ``st`` to download all files from the 'builders' container::
292+
293+ st -A https://<AUTH_HOSTNAME>:11000/v1.0 -U system:root -K testpass download builders
294+
295 .. _add-proxy-server:
296
297 Adding a Proxy Server