summaryrefslogtreecommitdiff
path: root/install-guide/source/initial-rings.rst
blob: 37ae3b17fd36f12ddb257d5589395f3aedb2adca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
Create and distribute initial rings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Before starting the Object Storage services, you must create the initial
account, container, and object rings. The ring builder creates configuration
files that each node uses to determine and deploy the storage architecture.
For simplicity, this guide uses one region and two zones with 2^10 (1024)
maximum partitions, 3 replicas of each object, and 1 hour minimum time between
moving a partition more than once. For Object Storage, a partition indicates a
directory on a storage device rather than a conventional partition table.
For more information, see the
`Deployment Guide <http://docs.openstack.org/developer/swift/deployment_guide.html>`__.

.. note::
   Perform these steps on the controller node.

Create account ring
-------------------

The account server uses the account ring to maintain lists of containers.

#. Change to the ``/etc/swift`` directory.

#. Create the base ``account.builder`` file:

   .. code-block:: console

      # swift-ring-builder account.builder create 10 3 1

   .. note::

      This command provides no output.

#. Add each storage node to the ring:

   .. code-block:: console

      # swift-ring-builder account.builder \
        add --region 1 --zone 1 --ip STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS --port 6002 \
        --device DEVICE_NAME --weight DEVICE_WEIGHT

   Replace ``STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS`` with the IP address
   of the management network on the storage node. Replace ``DEVICE_NAME`` with a
   storage device name on the same storage node. For example, using the first
   storage node in :ref:`storage` with the ``/dev/sdb`` storage
   device and weight of 100:

   .. code-block:: console

      # swift-ring-builder account.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6002 --device sdb --weight 100

   Repeat this command for each storage device on each storage node. In the
   example architecture, use the command in four variations:

   .. code-block:: console

      # swift-ring-builder account.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6002 --device sdb --weight 100
      Device d0r1z1-10.0.0.51:6002R10.0.0.51:6002/sdb_"" with 100.0 weight got id 0
      # swift-ring-builder account.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6002 --device sdc --weight 100
      Device d1r1z2-10.0.0.51:6002R10.0.0.51:6002/sdc_"" with 100.0 weight got id 1
      # swift-ring-builder account.builder add \
        --region 1 --zone 2 --ip 10.0.0.52 --port 6002 --device sdb --weight 100
      Device d2r1z3-10.0.0.52:6002R10.0.0.52:6002/sdb_"" with 100.0 weight got id 2
      # swift-ring-builder account.builder add \
        --region 1 --zone 2 --ip 10.0.0.52 --port 6002 --device sdc --weight 100
      Device d3r1z4-10.0.0.52:6002R10.0.0.52:6002/sdc_"" with 100.0 weight got id 3

#. Verify the ring contents:

   .. code-block:: console

      # swift-ring-builder account.builder
      account.builder, build version 4
      1024 partitions, 3.000000 replicas, 1 regions, 2 zones, 4 devices, 100.00 balance, 0.00 dispersion
      The minimum number of hours before a partition can be reassigned is 1
      The overload factor is 0.00% (0.000000)
      Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
                   0       1     1       10.0.0.51  6002       10.0.0.51              6002      sdb  100.00          0 -100.00
                   1       1     1       10.0.0.51  6002       10.0.0.51              6002      sdc  100.00          0 -100.00
                   2       1     2       10.0.0.52  6002       10.0.0.52              6002      sdb  100.00          0 -100.00
                   3       1     2       10.0.0.52  6002       10.0.0.52              6002      sdc  100.00          0 -100.00

#. Rebalance the ring:

   .. code-block:: console

      # swift-ring-builder account.builder rebalance
      Reassigned 1024 (100.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00

Create container ring
---------------------

The container server uses the container ring to maintain lists of objects.
However, it does not track object locations.

#. Change to the ``/etc/swift`` directory.

#. Create the base ``container.builder`` file:

   .. code-block:: console

      # swift-ring-builder container.builder create 10 3 1

   .. note::

      This command provides no output.

#. Add each storage node to the ring:

   .. code-block:: console

      # swift-ring-builder container.builder \
        add --region 1 --zone 1 --ip STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS --port 6001 \
        --device DEVICE_NAME --weight DEVICE_WEIGHT

   Replace ``STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS`` with the IP address
   of the management network on the storage node. Replace ``DEVICE_NAME`` with a
   storage device name on the same storage node. For example, using the first
   storage node in :ref:`storage` with the ``/dev/sdb``
   storage device and weight of 100:

   .. code-block:: console

      # swift-ring-builder container.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6001 --device sdb --weight 100

   Repeat this command for each storage device on each storage node. In the
   example architecture, use the command in four variations:

   .. code-block:: console

      # swift-ring-builder container.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6001 --device sdb --weight 100
      Device d0r1z1-10.0.0.51:6001R10.0.0.51:6001/sdb_"" with 100.0 weight got id 0
      # swift-ring-builder container.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6001 --device sdc --weight 100
      Device d1r1z2-10.0.0.51:6001R10.0.0.51:6001/sdc_"" with 100.0 weight got id 1
      # swift-ring-builder container.builder add \
        --region 1 --zone 2 --ip 10.0.0.52 --port 6001 --device sdb --weight 100
      Device d2r1z3-10.0.0.52:6001R10.0.0.52:6001/sdb_"" with 100.0 weight got id 2
      # swift-ring-builder container.builder add \
        --region 1 --zone 2 --ip 10.0.0.52 --port 6001 --device sdc --weight 100
      Device d3r1z4-10.0.0.52:6001R10.0.0.52:6001/sdc_"" with 100.0 weight got id 3

#. Verify the ring contents:

   .. code-block:: console

      # swift-ring-builder container.builder
      container.builder, build version 4
      1024 partitions, 3.000000 replicas, 1 regions, 2 zones, 4 devices, 100.00 balance, 0.00 dispersion
      The minimum number of hours before a partition can be reassigned is 1
      The overload factor is 0.00% (0.000000)
      Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
                   0       1     1       10.0.0.51  6001       10.0.0.51              6001      sdb  100.00          0 -100.00
                   1       1     1       10.0.0.51  6001       10.0.0.51              6001      sdc  100.00          0 -100.00
                   2       1     2       10.0.0.52  6001       10.0.0.52              6001      sdb  100.00          0 -100.00
                   3       1     2       10.0.0.52  6001       10.0.0.52              6001      sdc  100.00          0 -100.00

#. Rebalance the ring:

   .. code-block:: console

      # swift-ring-builder container.builder rebalance
      Reassigned 1024 (100.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00

Create object ring
------------------

The object server uses the object ring to maintain lists of object locations
on local devices.

#. Change to the ``/etc/swift`` directory.

#. Create the base ``object.builder`` file:

   .. code-block:: console

      # swift-ring-builder object.builder create 10 3 1

   .. note::

      This command provides no output.

#. Add each storage node to the ring:

   .. code-block:: console

      # swift-ring-builder object.builder \
        add --region 1 --zone 1 --ip STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS --port 6000 \
        --device DEVICE_NAME --weight DEVICE_WEIGHT

   Replace ``STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS`` with the IP address
   of the management network on the storage node. Replace ``DEVICE_NAME`` with
   a storage device name on the same storage node. For example, using the first
   storage node in :ref:`storage` with the ``/dev/sdb`` storage
   device and weight of 100:

   .. code-block:: console

      # swift-ring-builder object.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6000 --device sdb --weight 100

   Repeat this command for each storage device on each storage node. In the
   example architecture, use the command in four variations:

   .. code-block:: console

      # swift-ring-builder object.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6000 --device sdb --weight 100
      Device d0r1z1-10.0.0.51:6000R10.0.0.51:6000/sdb_"" with 100.0 weight got id 0
      # swift-ring-builder object.builder add \
        --region 1 --zone 1 --ip 10.0.0.51 --port 6000 --device sdc --weight 100
      Device d1r1z2-10.0.0.51:6000R10.0.0.51:6000/sdc_"" with 100.0 weight got id 1
      # swift-ring-builder object.builder add \
        --region 1 --zone 2 --ip 10.0.0.52 --port 6000 --device sdb --weight 100
      Device d2r1z3-10.0.0.52:6000R10.0.0.52:6000/sdb_"" with 100.0 weight got id 2
      # swift-ring-builder object.builder add \
        --region 1 --zone 2 --ip 10.0.0.52 --port 6000 --device sdc --weight 100
      Device d3r1z4-10.0.0.52:6000R10.0.0.52:6000/sdc_"" with 100.0 weight got id 3

#. Verify the ring contents:

   .. code-block:: console

      # swift-ring-builder object.builder
      object.builder, build version 4
      1024 partitions, 3.000000 replicas, 1 regions, 2 zones, 4 devices, 100.00 balance, 0.00 dispersion
      The minimum number of hours before a partition can be reassigned is 1
      The overload factor is 0.00% (0.000000)
      Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
                   0       1     1       10.0.0.51  6000       10.0.0.51              6000      sdb  100.00          0 -100.00
                   1       1     1       10.0.0.51  6000       10.0.0.51              6000      sdc  100.00          0 -100.00
                   2       1     2       10.0.0.52  6000       10.0.0.52              6000      sdb  100.00          0 -100.00
                   3       1     2       10.0.0.52  6000       10.0.0.52              6000      sdc  100.00          0 -100.00

#. Rebalance the ring:

   .. code-block:: console

      # swift-ring-builder object.builder rebalance
      Reassigned 1024 (100.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00

Distribute ring configuration files
-----------------------------------

* Copy the ``account.ring.gz``, ``container.ring.gz``, and
  ``object.ring.gz`` files to the ``/etc/swift`` directory
  on each storage node and any additional nodes running the
  proxy service.