Ubuntu 14.04
Sponsored Link

OpenStack Icehouse : Swift 設定#2 (Proxy ノード)2014/06/11

 
OpenStack Object Storage(Swift)を設定します。
ここでは以下のように、Control ノード、Proxy ノード、Storage ノードと、 ノードごとにサーバーを用意して、計5台を使って設定します。
                                    |
     +------------------+           |           +-----------------+
     | [ Control Node ] |10.0.0.30  |  10.0.0.70|  [ Proxy Node ] |
     |     Keystone     |-----------+-----------|                 |
     +------------------+           |           +-----------------+
                                    |
        +---------------------------+--------------------------+
        |                           |                          |
        |10.0.0.71                  |10.0.0.72                 |10.0.0.73 
+-------+----------+       +--------+---------+       +--------+---------+
| [Storage Node#1] |       | [Storage Node#2] |       | [Storage Node#3] |
|                  |-------|                  |-------|                  |
+------------------+       +------------------+       +------------------+

 
ここでは Proxy ノードの設定をします。
[1] Swift-Proxy をインストールします。
root@proxy:~#
apt-get -y install swift swift-proxy memcached python-keystoneclient python-swiftclient python-webob
[2] Swift-Proxy を設定します。
root@proxy:~#
vi /etc/memcached.conf
# 35行目:自ホストのIPに変更

-l
10.0.0.70
root@proxy:~#
/etc/init.d/memcached restart

Restarting memcached: memcached.
root@proxy:~#
mkdir /etc/swift

root@proxy:~#
vi /etc/swift/proxy-server.conf
# 新規作成

[DEFAULT]
bind_ip = 0.0.0.0
bind_port = 8080
user = swift
[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth proxy-server
[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true
# Keystone の認証情報を指定

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.0.0.30
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = swift
admin_password = servicepassword
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin,swiftoperator
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:cache]
use = egg:swift#memcache
[filter:catch_errors]
use = egg:swift#catch_errors
root@proxy:~#
vi /etc/swift/swift.conf
# 新規作成

# Swiftノード間でシェアする値を指定する (適当な文字列でOK)

[swift-hash]
swift_hash_path_suffix = swift_shared_path
swift_hash_path_prefix = swift_shared_path
[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.71:6002/device0 100

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

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

Device d0r0z0-10.0.0.71:6000R10.0.0.71:6000/device0_"" with 100.0 weight got id 0
root@proxy:~#
swift-ring-builder /etc/swift/account.builder add r1z1-10.0.0.72:6002/device1 100

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

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

Device d1r1z1-10.0.0.72:6000R10.0.0.72:6000/device1_"" with 100.0 weight got id 1
root@proxy:~#
swift-ring-builder /etc/swift/account.builder add r2z2-10.0.0.73:6002/device2 100

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

Device d2r2z2-10.0.0.73:6001R10.0.0.73:6001/device2_"" with 100.0 weight got id 2
root@proxy:~#
swift-ring-builder /etc/swift/object.builder add r2z2-10.0.073:6000/device2 100

Device d2r2z2-10.0.073:6000R10.0.073: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 -R swift. /etc/swift

root@proxy:~#
initctl start swift-proxy

swift-proxy start/running
関連コンテンツ