温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

swift扩容

发布时间:2020-06-09 12:49:23 来源:网络 阅读:4783 作者:fire7758 栏目:移动开发

swift扩容有增加node节点的硬盘和增加node节点2种方式。

本文基于上篇 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内容

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

复制account.ring.gz, container.ring.gz, andobject.ring.gz到其他proxy NodeStorage Node

# scp *.ring.gz swift1:/etc/swift

# scp *.ring.gz swift2:/etc/swift

# scp *.ring.gz swift3:/etc/swift

所有node检查/etc/swift权限,owner修改为swift

#chown -R swift:swift /etc/swift/


二、添加新机器

如增加节点node4

在node4上做如下设置:(上篇的章节)

General Installation Steps for All Nodes

General Installation Steps for All Swift Nodesincludeproxy

时间同步

修改hosts文件

Swift Storage Node安装步骤

proxy Node上做如下设置

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内容

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

复制account.ring.gz, container.ring.gz, andobject.ring.gz到其他proxy NodeStorage 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权限,owner修改为swift

#chown -R swift:swift /etc/swift/

重启动proxy Node

#swift-init proxy restart

启动Node4

#swift-init all start

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI