swift擴容有增加node節(jié)點的硬盤和增加node節(jié)點2種方式。
牡丹ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!
本文基于上篇http://fire7758.blog.51cto.com/993821/1374190
一、Node中增加硬盤
如node2中增加硬盤擴容,這里以增加/dev/sdc為例。
1)Node2操作
#parted /dev/sdc mklabel gpt
#parted /dev/sdc mkpart primary 0% 100%
#mkfs.xfs -i size=1024 /dev/sdc1
#mkdir -p /srv/node/sdc1
#echo "/dev/sdc1 /srv/node/sdc1 xfsnoatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab
#mount /srv/node/sdc1
#chown -R swift:swift /srv/node/sdc1
2)ProxyNode操作
給Node2添加ring
swift-ring-builder account.builder add z2-192.168.1.228:6002/sdc1100
swift-ring-builder container.builder add z2-192.168.1.228:6001/sdc1100
swift-ring-builder object.builder add z2-192.168.1.228:6000/sdc1100
確認ring內(nèi)容
swift-ring-builder /etc/swift/account.builder
swift-ring-builder /etc/swift/container.builder
swift-ring-builder /etc/swift/object.builder
Rebalancethe rings
swift-ring-builder account.builder rebalance
swift-ring-builder container.builder rebalance
swift-ring-builder object.builder rebalance
復(fù)制account.ring.gz, container.ring.gz, andobject.ring.gz到其他proxy Node及Storage Node
# scp *.ring.gz swift1:/etc/swift
# scp *.ring.gz swift2:/etc/swift
# scp *.ring.gz swift3:/etc/swift
所有node檢查/etc/swift權(quán)限,owner修改為swift
#chown -R swift:swift /etc/swift/
二、添加新機器
如增加節(jié)點node4
在node4上做如下設(shè)置:(上篇的章節(jié))
General Installation Steps for All Nodes
General Installation Steps for All Swift Nodes(includeproxy)
時間同步
修改hosts文件
Swift Storage Node安裝步驟
在proxy Node上做如下設(shè)置
給node4添加ring
swift-ring-builder account.builder add z3-192.168.1.229:6002/loop100
swift-ring-builder container.builder add z3-192.168.1.229:6001/loop100
swift-ring-builder object.builder add z3-192.168.1.229:6000/loop100
確認ring內(nèi)容
swift-ring-builder /etc/swift/account.builder
swift-ring-builder /etc/swift/container.builder
swift-ring-builder /etc/swift/object.builder
Rebalancethe rings
swift-ring-builder account.builder rebalance
swift-ring-builder container.builder rebalance
swift-ring-builder object.builder rebalance
復(fù)制account.ring.gz, container.ring.gz, andobject.ring.gz到其他proxy Node及Storage Node
# scp *.ring.gz swift1:/etc/swift
# scp *.ring.gz swift2:/etc/swift
# scp *.ring.gz swift3:/etc/swift
# scp *.ring.gz swift4:/etc/swift
所有node檢查/etc/swift權(quán)限,owner修改為swift
#chown -R swift:swift /etc/swift/
重啟動proxy Node
#swift-init proxy restart
啟動Node4
#swift-init all start