CentOS 6
Sponsored Link

OpenStack Grizzly - Swift 設定#2 (プロキシノード)2013/08/23

 
OpenStack Object Storage(Swift)の設定です。
Swift は、認証ノード、プロキシノード、ストレージノードで構成されます。
これまでの例では Keystone, Glance, Cinder, Nova, Horizon を全て一つのサーバーにインストールする All-in-One 構成で設定してきましたが、 Swift の設定は以下のようにノードごとにサーバーを用意して、計5台を使って設定してみることにします。 (構築済みの All-in-One サーバーを認証ノードとして利用することにします)
                               |
     +------------+            |            +-----------+
     |  Auth Node |10.0.0.30   |   10.0.0.31|   Proxy   |
     | (Keystone) |------------+------------|    Node   |
     +------------+            |            +-----------+
                               |
      +------------------------+-----------------------+
      |                        |                       |
      |10.0.0.51               |10.0.0.52              |10.0.0.53
+-----------+            +-----------+           +-----------+
|  Storage  |            |  Storage  |           |  Storage  |
|   Node1   |------------|   Node2   |-----------|   Node3   |
+-----------+            +-----------+           +-----------+

 
ここではプロキシノードの設定をします。
[1] Swift-Proxy インストール
# EPEL OpenStack, EPELからインストール

[root@proxy ~]#
yum --enablerepo=epel-openstack-grizzly,epel -y install openstack-swift-proxy memcached openssh-clients
[2] Swift-Proxy 設定
[root@proxy ~]#
vi /etc/swift/proxy-server.conf
# 30行目:以下のように変更 (認証ノードの Keystone に登録した値)

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
admin_tenant_name =
service

admin_user =
swift

admin_password =
servicepassword

auth_host =
10.0.0.30

auth_port = 35357
auth_protocol = http
signing_dir = /tmp/keystone-signing-swift
[root@proxy ~]#
vi /etc/swift/swift.conf
# 以下のように変更 (Swiftノード間でシェアする値 - 適当な文字列でよい)

[swift-hash]
swift_hash_path_suffix =
swift_shared_path
[root@proxy ~]#
mkdir /tmp/keystone-signing-swift

[root@proxy ~]#
chown swift. /tmp/keystone-signing-swift

[3] Swift Ring ファイル設定
[root@proxy ~]#
swift-ring-builder /etc/swift/account.builder create 12 3 1

[root@proxy ~]#
swift-ring-builder /etc/swift/container.builder create 12 3 1

[root@proxy ~]#
swift-ring-builder /etc/swift/object.builder create 12 3 1
[root@proxy ~]#
swift-ring-builder /etc/swift/account.builder add r0z0-10.0.0.51:6002/device0 100

Device r0z0-10.0.0.51:6002/device0_"" with 100.0 weight got id 0
[root@proxy ~]#
swift-ring-builder /etc/swift/container.builder add r0z0-10.0.0.51:6001/device0 100

Device r0z0-10.0.0.51:6001/device0_"" with 100.0 weight got id 0
[root@proxy ~]#
swift-ring-builder /etc/swift/object.builder add r0z0-10.0.0.51:6000/device0 100

Device r0z0-10.0.0.51:6000/device0_"" with 100.0 weight got id 0
[root@proxy ~]#
swift-ring-builder /etc/swift/account.builder add r1z1-10.0.0.52:6002/device1 100

Device r1z1-10.0.0.52:6002/device1_"" with 100.0 weight got id 1
[root@proxy ~]#
swift-ring-builder /etc/swift/container.builder add r1z1-10.0.0.52:6001/device1 100

Device r1z1-10.0.0.52:6001/device1_"" with 100.0 weight got id 1
[root@proxy ~]#
swift-ring-builder /etc/swift/object.builder add r1z1-10.0.0.52:6000/device1 100

Device r1z1-10.0.0.52:6000/device1_"" with 100.0 weight got id 1
[root@proxy ~]#
swift-ring-builder /etc/swift/account.builder add r2z2-10.0.0.53:6002/device2 100

Device r2z2-10.0.0.53:6002/device2_"" with 100.0 weight got id 2
[root@proxy ~]#
swift-ring-builder /etc/swift/container.builder add r2z2-10.0.0.53:6001/device2 100

Device r2z2-10.0.0.53:6001/device2_"" with 100.0 weight got id 2
[root@proxy ~]#
swift-ring-builder /etc/swift/object.builder add r2z2-10.0.0.53:6000/device2 100

Device r2z2-10.0.0.53:6000/device2_"" with 100.0 weight got id 2
[root@proxy ~]#
swift-ring-builder /etc/swift/account.builder rebalance

Reassigned 4096 (100.00%) partitions. Balance is now 0.00.
[root@proxy ~]#
swift-ring-builder /etc/swift/container.builder rebalance

Reassigned 4096 (100.00%) partitions. Balance is now 0.00.
[root@proxy ~]#
swift-ring-builder /etc/swift/object.builder rebalance

Reassigned 4096 (100.00%) partitions. Balance is now 0.00.
[root@proxy ~]#
chown swift. /etc/swift/*.gz

[root@proxy ~]#
/etc/rc.d/init.d/memcached start

Starting memcached: [ OK ]
[root@proxy ~]#
/etc/rc.d/init.d/openstack-swift-proxy start

Starting swift-proxy-server: [ OK ]
[root@proxy ~]#
chkconfig memcached on

[root@proxy ~]#
chkconfig openstack-swift-proxy on

関連コンテンツ