OpenStack Havana - Swift 設定#3 (ストレージノード)2013/10/28 |
OpenStack Object Storage(Swift)の設定です。
ここでは以下のように、認証ノード、プロキシノード、ストレージノードと、
ノードごとにサーバーを用意して、計5台を使って設定してみることにします。
| +------------+ | +-----------+ | Auth Node |10.0.0.30 | 10.0.0.50| Proxy | | (Keystone) |------------+------------| Node | +------------+ | +-----------+ | +------------------------+-----------------------+ | | | |10.0.0.51 |10.0.0.52 |10.0.0.53 +-----------+ +-----------+ +-----------+ | Storage | | Storage | | Storage | | Node1 |------------| Node2 |-----------| Node3 | +-----------+ +-----------+ +-----------+ |
ここではストレージノードの設定をします。
ストレージノードは、基本的に台数分全て同じ設定でOKですが、IPアドレスやデバイス名の数字については異なりますので、それぞれ注意して変更してください。 なお、この例では、ストレージノードとするサーバーにディスクを増設し、/dev/sdb1 にパーティションを作成して設定しています。 |
|
[1] | Swift-Account, Swift-Container, Swift-Object 等々インストール |
# EPEL OpenStack, EPELからインストール [root@node01 ~]# yum --enablerepo=openstack-havana,epel -y install openstack-swift-account openstack-swift-container openstack-swift-object xfsprogs xinetd rsync openssh-clients
|
[2] | ディスクの空き領域を XFS でフォーマットし、/srv/node にマウント (「device*」の数字はストレージノードごとに異なる箇所です) |
[root@node01 ~]# mkfs.xfs -i size=1024 /dev/sdb1 meta-data=/dev/sdb1 isize=1024 agcount=4, agsize=6553514 blks = sectsz=512 attr=2, projid32bit=0 data = bsize=4096 blocks=26214055, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=12799, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0[root@node01 ~]# mkdir -p /srv/node/device0 [root@node01 ~]# mount -o noatime,nodiratime,nobarrier /dev/sdb1 /srv/node/device0 [root@node01 ~]# chown -R swift. /srv/node
[root@node01 ~]#
vi /etc/fstab # 最終行に追記 /dev/sdb1 /srv/node/device0 xfs noatime,nodiratime,nobarrier 0 0 |
[3] | Swift Ring ファイルを Swift Proxy (プロキシノード) からコピー |
[root@proxy ~]# scp /etc/swift/*.gz 10.0.0.51:/etc/swift/ The authenticity of host '10.0.0.51 (10.0.0.51)' can't be established. RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:f3:ed:54. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.0.51' (RSA) to the list of known hosts. root@10.0.0.51's password: account.ring.gz 100% 3867 3.8KB/s 00:00 container.ring.gz 100% 3899 3.8KB/s 00:00 object.ring.gz 100% 3877 3.8KB/s 00:00 |
[4] | Swift Proxy (プロキシノード) からコピーしたSwift Ring ファイルの所有者を変更しておく |
[root@node01 ~]# chown swift. /etc/swift/*.gz |
[5] | Swift, Rsync 設定 |
[root@node01 ~]#
vi /etc/swift/swift.conf # プロキシノードに設定したものと同じ値 [swift-hash] swift_hash_path_suffix = swift_shared_path
[root@node01 ~]#
vi /etc/swift/account-server.conf # 2行目:自身のIPアドレスに変更 bind_ip = 10.0.0.51
[root@node01 ~]#
vi /etc/swift/container-server.conf # 2行目:自身のIPアドレスに変更 bind_ip = 10.0.0.51
[root@node01 ~]#
vi /etc/swift/object-server.conf # 2行目:自身のIPアドレスに変更 bind_ip = 10.0.0.51
[root@node01 ~]#
vi /etc/rsyncd.conf # 以下のように新規作成 pid file = /var/run/rsyncd.pid log file = /var/log/rsyncd.log uid = swift gid = swift address = 10.0.0.51 [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 |
[6] | 各サービス起動 |
[root@node01 ~]# chkconfig rsync on [root@node01 ~]# chkconfig xinetd on [root@node01 ~]# /etc/rc.d/init.d/xinetd start Starting xinetd: [ OK ] [root@node01 ~]# for ringtype in account container object; do
/etc/rc.d/init.d/openstack-swift-$ringtype start chkconfig openstack-swift-$ringtype on for service in replicator updater auditor; do if [ $ringtype != 'account' ] || [ $service != 'updater' ]; then /etc/rc.d/init.d/openstack-swift-$ringtype-$service start chkconfig openstack-swift-$ringtype-$service on fi done done Starting openstack-swift-account: [ OK ] Starting openstack-swift-account-replicator: [ OK ] Starting openstack-swift-account-auditor: [ OK ] Starting openstack-swift-container: [ OK ] Starting openstack-swift-container-replicator: [ OK ] Starting openstack-swift-container-updater: [ OK ] Starting openstack-swift-container-auditor: [ OK ] Starting openstack-swift-object: [ OK ] Starting openstack-swift-object-replicator: [ OK ] Starting openstack-swift-object-updater: [ OK ] Starting openstack-swift-object-auditor: [ OK ] |
Sponsored Link |
|