0.实验前的环境检查与配置
[student@workstation ~]$ lab extendvolume-lab setup
1.查看存储
gluster volume info important查看存储卷的信息。这里类型是分布式,即在已有的存储条之间进行分布,而存储条的数量为2,即在a3 b3之间进行分布。
[root@servera ~]# gluster volume info important
Volume Name: important
Type: Distribute
Volume ID: adb820eb-8f5d-41ba-9339-62c8cc8b17ab
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a3/brick
Brick2: serverb:/bricks/brick-b3/brick
Options Reconfigured:
performance.readdir-ahead: on
2.配置扩容
gluster volume add-brick important replica 2进行扩容添加两个存储条c3 d3并将副本复制数设置为2。gluster volume rebalance important start开始进行平衡操作。gluster volume rebalance important status可以查看过程状态知道全部完成。
[root@servera ~]# gluster volume add-brick important replica 2 \
> serverc:/bricks/brick-c3/brick \
> serverd:/bricks/brick-d3/brick
volume add-brick: success
[root@servera ~]# gluster volume rebalance important start
volume rebalance: important: success: Rebalance on important has been started successfully. Use rebalance status command to check status of the rebalance process.
ID: 8478e115-10db-4d46-b0bd-33587ed8ff54
[root@servera ~]# gluster volume rebalance important status
Node Rebalanced-files size scanned failures skipped status run time in secs
--------- ----------- ----------- ----------- ----------- ----------- ------------ --------------
localhost 0 0Bytes 27 0 0 in progress 20.00
serverb.lab.example.com 0 0Bytes 37 0 0 in progress 17.00
serverc.lab.example.com 0 0Bytes 0 0 0 completed 5.00
serverd.lab.example.com 0 0Bytes 0 0 0 completed 5.00
volume rebalance: important: success
[root@servera ~]# gluster volume rebalance important status
Node Rebalanced-files size scanned failures skipped status run time in secs
--------- ----------- ----------- ----------- ----------- ----------- ------------ --------------
localhost 0 0Bytes 49 0 0 completed 41.00
serverb.lab.example.com 0 0Bytes 51 0 0 completed 30.00
serverc.lab.example.com 0 0Bytes 0 0 0 completed 5.00
serverd.lab.example.com 0 0Bytes 0 0 0 completed 5.00
volume rebalance: important: success
3.配置确认
gluster volume info important查看存储卷信息。gluster volume info important | grep Type确然类型。注意:这里存储条已经变成4个,而且类型是分布复制,即先分布再复制,因为副本复制参数为2,所以数据会先在a3 b3和c3 d3进行分布,然后在a3 b3进行副本复制,在c3 d3进行副本复制
[root@servera ~]# gluster volume info important
Volume Name: important
Type: Distributed-Replicate
Volume ID: adb820eb-8f5d-41ba-9339-62c8cc8b17ab
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a3/brick
Brick2: serverc:/bricks/brick-c3/brick
Brick3: serverb:/bricks/brick-b3/brick
Brick4: serverd:/bricks/brick-d3/brick
Options Reconfigured:
performance.readdir-ahead: on
[root@servera ~]# gluster volume info important | grep Type
Type: Distributed-Replicate
4.任务测评
lab extendvolume-lab grade进行测评。主要包括:存储卷,存储条数量,存储卷类型,平衡功能状态等。
[student@workstation ~]$ lab extendvolume-lab grade
Grading the student's work:
· Testing for presence of important........................... PASS
· Testing volume type of important............................ PASS
· Testing if important is started............................. PASS
· Testing for number of bricks in important................... PASS
· Testing rebalance status on important....................... PASS
Overall lab grade.............................................. PASS