OpenStack Rocky : Swift 設定#3 (Storage ノード)2019/08/22 |
OpenStack Object Storage(Swift)を設定します。
当例では以下のような環境を例に Swift サービスを設定します。
------------+---------------------------+-------------+--- | | | eth0|10.0.0.30 eth0|10.0.0.50 | +-----------+-----------+ +-----------+-----------+ | | [ Control Node ] | | [ Proxy Node ] | | | | | | | | MariaDB RabbitMQ | | Swift Proxy | | | Memcached httpd | | | | | Keystone | | | | +-----------------------+ +-----------------------+ | | ------------+---------------------------+-------------+-------------+----------- eth0|10.0.0.71 eth0|10.0.0.72 eth0|10.0.0.73 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ Storage Node#1 ] | | [ Storage Node#2 ] | | [ Storage Node#3 ] | | | | | | | | Swift-Account | | Swift-Account | | Swift-Account | | Swift-Container | | Swift-Container | | Swift-Container | | Swift-Object | | Swift-Object | | Swift-Object | +-----------------------+ +-----------------------+ +-----------------------+ |
Storage ノードの設定をします。基本的に台数分全て同じ設定で OK ですが、IPアドレスについては異なりますので、それぞれ注意して変更ください。
なお、当例では、Storage ノードとするサーバーにディスクを増設し、/dev/sdb1 にパーティションを作成して設定しています。 |
|
[1] | 全 Storage ノード で Swift-Account, Swift-Container, Swift-Object 等々をインストールします。 |
root@snode01:~# apt -y install swift swift-account swift-container swift-object
|
[2] | 全 Storage ノード でディスクの空き領域を EXT4 でフォーマットし、/var/lib/swift/node にマウントします。 |
root@snode01:~# mkfs.ext4 /dev/sdb1 root@snode01:~# mkdir /var/lib/swift/node root@snode01:~# mount -o noatime,nodiratime,nobarrier /dev/sdb1 /var/lib/swift/node root@snode01:~# chown -R swift. /var/lib/swift/node
root@snode01:~#
vi /etc/fstab # 最終行に追記 /dev/sdb1 /var/lib/swift/node ext4 noatime,nodiratime,nobarrier 0 0 |
[3] | Proxy ノードから 全 Storage ノードへ Swift Ring ファイルをコピーします。 |
root@proxy:~# scp /etc/swift/*.gz 10.0.0.71:/etc/swift/ account.ring.gz 100% 3912 3.8KB/s 00:00 container.ring.gz 100% 3904 3.8KB/s 00:00 object.ring.gz 100% 3895 3.8KB/s 00:00 |
[4] | 全 Storage ノードで Swift および Rsync の設定をします。 |
root@snode01:~# chown swift. /etc/swift/*.gz
root@snode01:~#
vi /etc/swift/swift.conf # 9,10行目:変更 (プロキシノードに設定したものと同じ値) swift_hash_path_suffix = swift_shared_path swift_hash_path_prefix = swift_shared_path
root@snode01:~#
vi /etc/swift/account-server.conf # 3行目:変更 bind_port = 6002
# 8行目:変更 devices = /var/lib/swift
root@snode01:~#
vi /etc/swift/container-server.conf # 3行目:変更 bind_port = 6001
# 8行目:変更 devices = /var/lib/swift
root@snode01:~#
vi /etc/swift/object-server.conf # 3行目:変更 bind_port = 6000
# 8行目:変更 devices = /var/lib/swift
root@snode01:~#
vi /etc/rsyncd.conf # 新規作成
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
uid = swift
gid = swift
# それぞれのノードの IPアドレス
address = 10.0.0.71
[account]
path = /var/lib/swift
read only = false
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 25
lock file = /var/lock/account.lock
[container]
path = /var/lib/swift
read only = false
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 25
lock file = /var/lock/container.lock
[object]
path = /var/lib/swift
read only = false
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 25
lock file = /var/lock/object.lock
[swift_server]
path = /etc/swift
read only = true
write only = no
list = yes
incoming chmod = 0644
outgoing chmod = 0644
max connections = 5
lock file = /var/lock/swift_server.lock
root@snode01:~#
vi /etc/default/rsync # 14行目:変更 RSYNC_ENABLE= true
|
[5] | 各サービスを起動します。 |
root@snode01:~# systemctl restart rsync swift-account-auditor \ swift-account-replicator \ swift-account \ swift-container-auditor \ swift-container-replicator \ swift-container-updater \ swift-container \ swift-object-auditor \ swift-object-replicator \ swift-object-updater \ swift-object root@snode01:~# systemctl enable rsync swift-account-auditor \ swift-account-replicator \ swift-account \ swift-container-auditor \ swift-container-replicator \ swift-container-updater \ swift-container \ swift-object-auditor \ swift-object-replicator \ swift-object-updater \ swift-object |
Sponsored Link |