随着数据量的增长,需要扩容满足使用。今天测试下glusterfs磁盘扩容的具体步骤
1.扩容
之前用的2台计算机的分布式复制卷。需要同时之两个服务器增加一块磁盘并格式化,挂载并扩容
热添加磁盘echo "- - -" >/sys/class/scsi_host/host0/scanecho "- - -" >/sys/class/scsi_host/host1/scanecho "- - -" >/sys/class/scsi_host/host2/scan格式化mkfs.xfs -i size=512 /dev/sdc挂载mkdir /data/brick2 mount /dev/sdc /data/brick2 # 加入开机自启这里 卷停止gluster volume stop gv0扩容gluster volume add-brick gv0 replica 2 10.0.0.101:/data/brick2 10.0.0.105:/data/brick2 force启动卷gluster volume start
2.删除或者平衡卷
磁盘平衡:(一般用不着)gluster volume rebalance gv0 start查看平衡状态:gluster volume rebalance gv0 status 此处可以用df -h 查看挂载下的sdb sdc两个磁盘的容量最后会平均的。移除磁盘:gluster volume remove-brick gv0 replica 2 10.0.0.21:/data/storage2 10.0.0.22:/data/storage2 force删除卷:gluster volume delete gv0查看卷状态: gluster volume info
Volume Name: gv0
Type: Distributed-ReplicateVolume ID: 16d359d1-2570-4e21-ba13-0fe67fb999e0Status: StartedSnapshot Count: 0Number of Bricks: 2 x 2 = 4Transport-type: tcpBricks:Brick1: zklf-server01:/data/brick1/gv0Brick2: zklf-server02:/data/brick1/gv0Brick3: zklf-server01:/data/brick2Brick4: zklf-server02:/data/brick2Options Reconfigured:performance.client-io-threads: offnfs.disable: ontransport.address-family: inet从状态可以看出我们的操作是成功的。最后测试在gv0下创建同样的文件或其他是同步的。 目前先这样,看会文档或其他再补充内容