Swift 2 (config nodes)

السلام عليكم ورحمة الله وبركاته 

نواصل في شرح التثبيت

storage vm1 & storage vm2  في هذه الخطوة نفترض ان لدينا 

In each VM we have three partitions 

sda for OS

sdb & sdc for Storaging

 

Note

Perform these steps on each storage node.

yum install xfsprogs rsync

Format the /dev/sdb and /dev/sdc devices as XFS:

 mkfs.xfs /dev/sdb 
 mkfs.xfs /dev/sdc

Create the mount point directory structure:

 mkdir -p /srv/node/sdb 
 mkdir -p /srv/node/sdc

Edit the /etc/fstab file and add the following to it:

/dev/sdb /srv/node/sdb xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
/dev/sdc /srv/node/sdc xfs noatime,nodiratime,nobarrier,logbufs=8 0 2

Mount the devices:

mount /srv/node/sdb  
mount /srv/node/sdc

 ما قمنا به حتى الان هو تهيئة القرصين الاضافيين ومن ثم جعلهم 

auto mount on startup at /srv/node/sd*

Create or edit the /etc/rsyncd.conf file to contain the following:

uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = X.X.X.X
[account] max connections = 2 path = /srv/node/ read only = False lock file = /var/lock/account.lock [container] max connections = 2 path = /srv/node/ read only = False lock file = /var/lock/container.lock [object] max connections = 2 path = /srv/node/ read only = False lock file = /var/lock/object.lock

Replace X.X.X.X with node ip

Start the rsyncd service and configure it to start when the system boots:

systemctl enable rsyncd.service  
systemctl start rsyncd.service

Before Installing packages make sure you enabled openstack repo and downloaded openstack client

Install the packages:

 yum install openstack-swift-account openstack-swift-container \
  openstack-swift-object

Download configuration files

 curl -o /etc/swift/account-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?h=stable/queens 
 curl -o /etc/swift/container-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?h=stable/queens
 curl -o /etc/swift/object-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?h=stable/queens

Edit the /etc/swift/account-server.conf

[DEFAULT]
...
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6202
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
[pipeline:main]
pipeline = healthcheck recon account-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift

Edit the /etc/swift/container-server.conf

[DEFAULT]
...
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6201
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
[pipeline:main]
pipeline = healthcheck recon container-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift

Edit the /etc/swift/object-server.conf

[DEFAULT]
...
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6200
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
[pipeline:main]
pipeline = healthcheck recon object-server
[filter:recon]
use = egg:swift#recon
...
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock

Ensure proper ownership of the mount point directory structure:

 chown -R swift:swift /srv/node

Create the recon directory and ensure proper ownership of it:

 mkdir -p /var/cache/swift  
chown -R root:swift /var/cache/swift
 chmod -R 775 /var/cache/swift

نكتفي بهذا القدر حتى هذه اللحظة  

نكمل في الدرس القادم

Leave a Reply