第一次创建复制卷的命令:replica 2 双副本机制,后面跟每个节点的brick gluster volume create myvolume replica 2 transport tcp 10.32.1.130:/glusterfs/data 10.32.1.131:/glusterfs/data
修改IP:cd /var/lib cp -r glusterd/ /tmp/glusterd20170315 备份glusterd配置文件 gluster volume stop myvolume 停止卷 service glusterd stop 停止glusterd服务 cd /var/lib/glusterd/ grep -rl 10.32.1.130 ./ | xargs sed -i 's/10.32.1.130/10.41.0.174/g' 查询/var/lib/glusterd目录下面的配置文件中原来的IP(10.32.1.130)修改为新的ip(10.41.0.174) grep -rl 10.32.1.131 ./ | xargs sed -i 's/10.32.1.131/10.41.0.175/g' 查询/var/lib/glusterd目录下面的配置文件中原来的IP(10.32.1.130)修改为新的ip(10.41.0.175) cd /var/lib/glusterd/vols/myvolume mv myvolume.10.32.1.130.glusterfs-data.vol myvolume.10.41.0.174.glusterfs-data.vol mv myvolume.10.32.1.131.glusterfs-data.vol myvolume.10.41.0.175.glusterfs-data.vol 修改原来带有旧IP(10.32.1.130)的文件为新的IP(10.41.0.174)的文件; 修改原来带有旧IP(10.32.1.131)的文件为新的IP(10.41.0.175)的文件; cd bricks/ mv 10.32.1.130\:-glusterfs-data 10.41.0.174\:-glusterfs-data mv 10.32.1.131\:-glusterfs-data 10.41.0.175\:-glusterfs-data 修改原来带有旧IP(10.32.1.130)的文件为新的IP(10.41.0.174)的文件; 修改原来带有旧IP(10.32.1.131)的文件为新的IP(10.41.0.175)的文件;
扩容命令如下:gluster peer probe 10.41.0.178 在任意一台glusterFS节点上面操作,添加新增的节点 gluster peer probe 10.41.0.179 gluster peer probe 10.41.0.180 gluster peer probe 10.41.0.181 gluster peer probe 10.41.0.182 gluster peer probe 10.41.0.183 gluster peer probe 10.41.0.184 gluster peer probe 10.41.0.185 gluster volume add-brick myvolume 10.41.0.178:/glusterfs/data 10.41.0.179:/glusterfs/data 10.41.0.180:/glusterfs/data 10. 41.0.181:/glusterfs/data 10.41.0.182:/glusterfs/data 10.41.0.183:/glusterfs/data 10.41.0.184:/glusterfs/data 10.41.0.185:/glusterfs/data gluster volume rebalance myvolume start 启动均衡设置 gluster volume rebalance myvolume status 查看均衡状态
[root@WH0PRDIMS03AP0003 myvolume]# gluster volume info myvolume 查看卷的状态,以前是两台节点的时候是复制卷,目前是10个节点的时候是分布式复制卷,也就是第一个数据file1写入node1复制到node2,第二个数据file2写入到node3复制到node4,以此类推;
Volume Name: myvolume Type: Distributed-Replicate Volume ID: 56d4ddf3-b38a-4f6c-8c11-dcb2dc5dedba Status: Started Number of Bricks: 5 x 2 = 10 Transport-type: tcp Bricks: Brick1: 10.41.0.174:/glusterfs/data Brick2: 10.41.0.175:/glusterfs/data Brick3: 10.41.0.178:/glusterfs/data ------------------------
|
|
glusterFS存储平台部署
最新推荐文章于 2024-04-09 18:09:51 发布