ClusterStorage-2-配置Cluster Storage之搭建Volume

0.实验前的环境检查。

[student@workstation ~]$ lab setup-volume setup

Testing if server and serverb are ready for lab exercise work:

 · Testing if servera is reachable.............................  PASS
 · Testing if serverb is reachable.............................  PASS
 · Testing runtime firewall on servera for glusterfs...........  PASS
 · Testing permanent firewall on servera for glusterfs.........  PASS
 · Testing runtime firewall on serverb for glusterfs...........  PASS
 · Testing permanent firewall on serverb for glusterfs.........  PASS
 · Testing if glusterd is active on servera....................  PASS
 · Testing if glusterd is active on serverb....................  PASS
 · Testing if glusterd is active on servera....................  PASS
 · Testing if glusterd is active on serverb....................  PASS
 · Testing if both servera and serverb are in pool.............  PASS
Infrastructure setup status:...................................  PASS

Testing if all required bricks are present:

 · Testing for thinly provisioned pool on servera..............  PASS
 · Testing for thinly provisioned pool size on servera.........  PASS
 · Testing for mounted file system and type on servera.........  PASS
 · Testing for brick SELinux context on servera................  PASS
 · Testing for thinly provisioned pool on serverb..............  PASS
 · Testing for thinly provisioned pool size on serverb.........  PASS
 · Testing for mounted file system and type on serverb.........  PASS
 · Testing for brick SELinux context on serverb................  PASS
Brick setup status.............................................  PASS

 

1.创建volume

在servera上,gluster volume create firstvol servera:/bricks/brick-a1/brick serverb:/bricks/brick-b1/brick使用servera和serverb上的brick创建名为firstvol的volume。 gluster volume info firstvol查看volume信息(注意此时为created状态)。gluster volume start firstvol启用firstvol。gluster volume info firstvol查看volume信息(注意此时为Started状态)。

[root@servera ~]# gluster volume create firstvol \
> servera:/bricks/brick-a1/brick \
> serverb:/bricks/brick-b1/brick
volume create: firstvol: success: please start the volume to access data

[root@servera ~]# gluster volume info firstvol
 
Volume Name: firstvol
Type: Distribute
Volume ID: 5e73c66e-a03f-4760-aacc-803305f62268
Status: Created
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a1/brick
Brick2: serverb:/bricks/brick-b1/brick
Options Reconfigured:
performance.readdir-ahead: on
[root@servera ~]# gluster volume start firstvol
volume start: firstvol: success
[root@servera ~]# gluster volume info firstvol
 
Volume Name: firstvol
Type: Distribute
Volume ID: 5e73c66e-a03f-4760-aacc-803305f62268
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a1/brick
Brick2: serverb:/bricks/brick-b1/brick
Options Reconfigured:
performance.readdir-ahead: on
 

2.安装glusterfs文件系统

yum install glusterfs-fuse -y安装软件包。mount -t glusterfs servera:firstvol /mnt将servera:firstvol挂载到/mnt。df -Th | grep gluster查看文件信息。mount | grep gluster查看挂载。touch /mnt/file{0..0100}在挂载点目录中测试写入文件。 ll /mnt/file* | tail -5确认文件已写入挂载点。umount /mnt取消挂载。

[root@workstation ~]# yum install glusterfs-fuse -y
[root@workstation ~]# mount -t glusterfs servera:firstvol /mnt
[root@workstation ~]# df -Th | grep gluster
servera:firstvol fuse.glusterfs  4.0G   66M  4.0G   2% /mnt
[root@workstation ~]# mount | grep gluster
servera:firstvol on /mnt type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)
[root@workstation ~]# touch /mnt/file{0..0100}
[root@workstation ~]# ll /mnt/file* | tail -5
-rw-r--r--. 1 root root 0 Jan 21 14:30 /mnt/file0096
-rw-r--r--. 1 root root 0 Jan 21 14:30 /mnt/file0097
-rw-r--r--. 1 root root 0 Jan 21 14:30 /mnt/file0098
-rw-r--r--. 1 root root 0 Jan 21 14:30 /mnt/file0099
-rw-r--r--. 1 root root 0 Jan 21 14:30 /mnt/file0100
[root@workstation ~]# umount /mnt
 

3.查看写入的文件

ll /bricks/brick-a1/brick查看servera中的brick里的文件,文件随机分配。ll /bricks/brick-b1/brick查看serverb中的brick里的文件,文件随机分配。写入挂载点的文件随机分配后写入了servera和serverb的brick。

[root@servera ~]# ll /bricks/brick-a1/brick
total 0
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0001
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0003
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0004
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0005
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0008
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0009
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0010
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0012
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0015
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0016
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0017
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0019
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0023
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0024
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0025
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0028
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0029
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0030
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0031
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0032
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0038
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0039
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0040
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0041
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0042
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0046
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0047
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0048
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0051
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0054
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0055
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0057
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0059
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0060
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0064
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0067
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0068
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0069
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0071
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0073
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0074
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0077
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0081
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0082
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0086
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0087
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0088
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0091
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0092
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0097

[root@serverb ~]# ll /bricks/brick-b1/brick
total 0
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0000
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0002
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0006
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0007
-rw-r--r--. 2 root root 0 Jan 21 14:29 file0011
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0013
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0014
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0018
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0020
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0021
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0022
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0026
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0027
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0033
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0034
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0035
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0036
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0037
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0043
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0044
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0045
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0049
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0050
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0052
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0053
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0056
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0058
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0061
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0062
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0063
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0065
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0066
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0070
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0072
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0075
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0076
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0078
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0079
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0080
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0083
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0084
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0085
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0089
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0090
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0093
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0094
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0095
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0096
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0098
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0099
-rw-r--r--. 2 root root 0 Jan 21 14:30 file0100
 

4.任务测评。

lab setup-volume grade对任务进行测评。测评内容主要为:volume是否创建,里面的brick是否准确,是否分配了servera和serverb的brick,volume是否启动。

[student@workstation ~]$ lab setup-volume grade

Grading the student's work:

 · Checking if volume firstvol exists..........................  PASS
 · Checking number of bricks in firstvol.......................  PASS
 · Checking presence of servera brick..........................  PASS
 · Checking presence of serverb brick..........................  PASS
 · Checking if firstvol is started.............................  PASS

Overall lab grade..............................................  PASS
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值