swift/install-guide/source/initial-rings.rst
Petr Kovar cf8b93918c Add install-guide for swift
This adds swift-specific contents from the OpenStack Installation Guide
in the swift repo per [1]. A separate change will remove the swift contents
from the OpenStack Installation Guide for Newton per [2].

The swift install-guide structure is based on the Install Guide
Cookiecutter [3].

Also adds tox.ini environment for install-guide and adds
openstackdocs-theme to test-requirements.txt.

[1] http://specs.openstack.org/openstack/docs-specs/specs/newton/project-specific-installguides.html
[2] http://specs.openstack.org/openstack/docs-specs/specs/newton/installguide.html
[3] http://git.openstack.org/cgit/openstack/installguide-cookiecutter/

Change-Id: I59b92eebaf5acc657b97bcf10d9ff2cf2db05885
Partially-Implements: blueprint projectspecificinstallguides
Depends-On: Ifebc65b188c4f2ba35b61c0deae5ec24401df7f9
2016-07-07 08:00:21 +02:00

11 KiB

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.

Note

Perform these steps on the controller node.

Create account ring

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

  1. Change to the /etc/swift directory.

  2. Create the base account.builder file:

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

    Note

    This command provides no output.

  3. Add each storage node to the ring:

    # 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 storage with the /dev/sdb storage device and weight of 100:

    # 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:

    # 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
  4. Verify the ring contents:

    # 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
  5. Rebalance the ring:

    # 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.

  1. Change to the /etc/swift directory.

  2. Create the base container.builder file:

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

    Note

    This command provides no output.

  3. Add each storage node to the ring:

    # 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 storage with the /dev/sdb storage device and weight of 100:

    # 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:

    # 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
  4. Verify the ring contents:

    # 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
  5. Rebalance the ring:

    # 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.

  1. Change to the /etc/swift directory.

  2. Create the base object.builder file:

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

    Note

    This command provides no output.

  3. Add each storage node to the ring:

    # 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 storage with the /dev/sdb storage device and weight of 100:

    # 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:

    # 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
  4. Verify the ring contents:

    # 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
  5. Rebalance the ring:

    # 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.