Debian 10 Buster
Sponsored Link

OpenStack Rocky : Configure Swift (Storage Node)2019/08/22

 
Configure OpenStack Object Storage (Swift).
This example is based on the emvironment like follows.
------------+---------------------------+-------------+---
            |                           |             |
        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      |
+-----------------------+   +-----------------------+   +-----------------------+

 
Configure Storage Node on this section. It's OK to set the same settings mostly on all Storage Nodes, but only IP address is different each other, though.
Furthermore, add Hard drives on each Storage Nodes and create a partition [/dev/sdb1] for this settings.
[1] Install Swift-Account, Swift-Container, Swift-Object on all Storage Nodes.
root@snode01:~#
apt -y install swift swift-account swift-container swift-object
[2] Format free space of disk (/dev/sdb1 on this example) with EXT4 and mount on /var/lib/swift/node on all Storage Node like follows.
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
# add to the end

/dev/sdb1               /var/lib/swift/node   ext4    noatime,nodiratime,nobarrier 0 0
[3] Copy Swift Ring files from the Swift Proxy Node to all Storage Nodes.
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] Configure Swift and Rsync on all Storage Nodes.
root@snode01:~#
chown swift. /etc/swift/*.gz

root@snode01:~#
vi /etc/swift/swift.conf
# line 9,10: change (it's the value set on Proxy Node)

swift_hash_path_suffix =
swift_shared_path

swift_hash_path_prefix =
swift_shared_path
root@snode01:~#
vi /etc/swift/account-server.conf
# line 3: change

bind_port =
6002
# line 8: change

devices =
/var/lib/swift
root@snode01:~#
vi /etc/swift/container-server.conf
# line 3: change

bind_port =
6001
# line 8: change

devices =
/var/lib/swift
root@snode01:~#
vi /etc/swift/object-server.conf
# line 3: change

bind_port =
6000
# line 8: change

devices =
/var/lib/swift
root@snode01:~#
vi /etc/rsyncd.conf
# create new

pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
uid = swift
gid = swift
# IP address of each Node
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
# line 14: change

RSYNC_ENABLE=
true
[5] Start Swift services.
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

Matched Content