OpenStack Dalmatian : Swift 設定 (Storage ノード)2024/10/14 |
OpenStack Object Storage(Swift)を設定します。 当例では以下のような環境を例に Swift サービスを設定します。 ------------+--------------------------+------------ | | eth0|10.0.0.30 eth0|10.0.0.50 +-----------+-----------+ +-----------+-----------+ | [ dlp.srv.world ] | | [ network.srv.world ] | | (Control Node) | | (Proxy Node) | | | | | | MariaDB RabbitMQ | | Swift Proxy | | Memcached Nginx | | Nginx | | Keystone httpd | | | +-----------------------+ +-----------------------+ ------------+--------------------------+--------------------------+----------- eth0|10.0.0.71 eth0|10.0.0.72 eth0|10.0.0.73 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [snode01.srv.world] | | [snode02.srv.world] | | [snode03.srv.world] | | (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 ノードの設定を実施します。 |
|
[1] | 全 Storage ノード で こちらの [3] を参考に OpenStack Dalmatian リポジトリを設定後、Swift-Account, Swift-Container, Swift-Object 等々をインストールします。 |
root@snode01:~# apt -y install swift swift-account swift-container swift-object xfsprogs
|
[2] | 全 Storage ノード でディスクの空き領域を XFS でフォーマットし、[/srv/node] にマウントします。 |
root@snode01:~# mkfs.xfs /dev/sdb1 meta-data=/dev/sdb1 isize=512 agcount=4, agsize=10485696 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=1 = reflink=1 bigtime=1 inobtcount=1 nrext64=0 data = bsize=4096 blocks=41942784, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=20479, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 Discarding blocks...Done.
root@snode01:~#
mkdir -p /srv/node/device root@snode01:~# mount -o noatime,nodiratime /dev/sdb1 /srv/node/device root@snode01:~# chown -R swift:swift /srv/node
root@snode01:~#
blkid | grep sdb1 /dev/sdb1: UUID="13738d6d-999a-402a-9abd-2f436e2c5c4b" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="3cfdf937-01" root@snode01:~# vi /etc/fstab # 最終行に追記 /dev/disk/by-uuid/13738d6d-999a-402a-9abd-2f436e2c5c4b /srv/node/device xfs defaults,noatime,nodiratime 0 0 |
[3] | Proxy ノードから 全 Storage ノードへ Swift Ring ファイルをコピーします。 |
root@network:~# 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:swift /etc/swift/*.gz
root@snode01:~#
vi /etc/swift/swift.conf # プロキシノードに設定したものと同じ値 [swift-hash] swift_hash_path_suffix = swift_shared_path swift_hash_path_prefix = swift_shared_path
root@snode01:~#
vi /etc/swift/account-server.conf # 2行目 : 設定確認 bind_ip = 0.0.0.0 bind_port = 6002
root@snode01:~#
vi /etc/swift/container-server.conf # 2行目 : 設定確認 bind_ip = 0.0.0.0 bind_port = 6001
root@snode01:~#
vi /etc/swift/object-server.conf # 2行目 : 設定確認 bind_ip = 0.0.0.0 bind_port = 6000
root@snode01:~#
vi /etc/rsyncd.conf # 新規作成 pid file = /var/run/rsyncd.pid log file = /var/log/rsyncd.log uid = swift gid = swift address = 0.0.0.0 [account] path = /srv/node 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 = /srv/node 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 = /srv/node 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 \
root@snode01:~# 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 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 |