初期リングの作成と配布

初期リングの作成と配布

Object Storage サービスを起動する前に、アカウント、コンテナー、オブジェクトの初期リングを作成する必要があります。リングビルダーが、各ノードがストレージアーキテクチャーを判断して配備するために使用する、設定ファイルを作成します。このガイドは、簡単のため、1 リージョン、 1 ゾーンで、ゾーンの最大パーティション数 2^10 (1024)、各オブジェクトの複製数 3、パーティション移動後の再移動の最小間隔として 1 時間を使用します。 Object Storage では、パーティションは伝統的なパーティションテーブルではなく、ストレージデバイスにおけるディレクトリーを意味します。詳細は Deployment Guide を参照してください。

注釈

コントローラーノードにおいて、これらの手順を実行します。

アカウントリングの作成

アカウントサーバーは、コンテナーの一覧を管理するために、アカウントリングを使用します。

  1. /etc/swift ディレクトリーに移動します。

  2. ベースの account.builder ファイルを作成します。

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

    注釈

    このコマンドは何も出力しません。

  3. 各ストレージノードをリングに追加します。

    # 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
    

    STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS をストレージノードの管理ネットワークの IP アドレスに置き換えます。DEVICE_NAME を同じストレージノードのストレージデバイス名に置き換えます。例えば、ストレージノードのインストールと設定 にある 1 番目のストレージノード、ストレージデバイス /dev/sdb を使用し、ウェイト を 100 にします。

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

    各ストレージノードの各ストレージデバイスごとに、このコマンドを繰り返します。このサンプルアーキテクチャーは、このコマンドを 4 つ使用します。

    # 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 2 --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 3 --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 4 --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. リングの内容を検証します。

    # swift-ring-builder account.builder
    account.builder, build version 4
    1024 partitions, 3.000000 replicas, 1 regions, 4 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     2       10.0.0.51  6002       10.0.0.51              6002      sdc  100.00          0 -100.00
                 2       1     3       10.0.0.52  6002       10.0.0.52              6002      sdb  100.00          0 -100.00
                 3       1     4       10.0.0.52  6002       10.0.0.52              6002      sdc  100.00          0 -100.00
    
  5. リングをリバランスします。

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

コンテナーリングの作成

コンテナーサーバーは、オブジェクトの一覧を管理するために、コンテナーリングを使用します。ただし、オブジェクトの位置の把握は行いません。

  1. /etc/swift ディレクトリーに移動します。

  2. ベースの container.builder ファイルを作成します。

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

    注釈

    このコマンドは何も出力しません。

  3. 各ストレージノードをリングに追加します。

    # 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
    

    STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS をストレージノードの管理ネットワークの IP アドレスに置き換えます。DEVICE_NAME を同じストレージノードのストレージデバイス名に置き換えます。例えば、ストレージノードのインストールと設定 にある 1 番目のストレージノード、ストレージデバイス /dev/sdb を使用し、ウェイト を 100 にします。

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

    各ストレージノードの各ストレージデバイスごとに、このコマンドを繰り返します。このサンプルアーキテクチャーは、このコマンドを 4 つ使用します。

    # 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 2 --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 3 --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 4 --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. リングの内容を検証します。

    # swift-ring-builder container.builder
    container.builder, build version 4
    1024 partitions, 3.000000 replicas, 1 regions, 4 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     2       10.0.0.51  6001       10.0.0.51              6001      sdc  100.00          0 -100.00
                 2       1     3       10.0.0.52  6001       10.0.0.52              6001      sdb  100.00          0 -100.00
                 3       1     4       10.0.0.52  6001       10.0.0.52              6001      sdc  100.00          0 -100.00
    
  5. リングをリバランスします。

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

オブジェクトリングの作成

オブジェクトサーバーは、ローカルデバイスのおけるオブジェクトの位置の一覧を維持するために、オブジェクトリングを使用します。

  1. /etc/swift ディレクトリーに移動します。

  2. ベースの object.builder ファイルを作成します。

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

    注釈

    このコマンドは何も出力しません。

  3. 各ストレージノードをリングに追加します。

    # 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
    

    STORAGE_NODE_MANAGEMENT_INTERFACE_IP_ADDRESS をストレージノードの管理ネットワークの IP アドレスに置き換えます。DEVICE_NAME を同じストレージノードのストレージデバイス名に置き換えます。例えば、ストレージノードのインストールと設定 にある 1 番目のストレージノード、ストレージデバイス /dev/sdb を使用し、ウェイト を 100 にします。

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

    各ストレージノードの各ストレージデバイスごとに、このコマンドを繰り返します。このサンプルアーキテクチャーは、このコマンドを 4 つ使用します。

    # 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 2 --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 3 --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 4 --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. リングの内容を検証します。

    # swift-ring-builder object.builder
    object.builder, build version 4
    1024 partitions, 3.000000 replicas, 1 regions, 4 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     2       10.0.0.51  6000       10.0.0.51              6000      sdc  100.00          0 -100.00
                 2       1     3       10.0.0.52  6000       10.0.0.52              6000      sdb  100.00          0 -100.00
                 3       1     4       10.0.0.52  6000       10.0.0.52              6000      sdc  100.00          0 -100.00
    
  5. リングをリバランスします。

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

リング設定ファイルの配布

  • 各ストレージノード、プロキシーサービスを実行している追加ノードのに /etc/swift ディレクトリーに、 account.ring.gz ファイル、container.ring.gz ファイル、object.ring.gz ファイルをコピーします。

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

Search