0.实验前的环境检查与配置
[student@workstation ~]$ lab clients-lab setup
1.配置防火墙
firewall-cmd --add-service=rpc-bind --add-service=nfs放行服务。 firewall-cmd --runtime-to-permanent永久放行。
[root@servera ~]# firewall-cmd --add-service=rpc-bind --add-service=nfs
Warning: ALREADY_ENABLED
[root@servera ~]# firewall-cmd --runtime-to-permanent
success
2.配置选项设置
gluster volume set wallace nfs.disable on禁用nfs的功能开启。 gluster volume set wallace auth.allow 172.25.250.254允许指定地址访问。gluster volume stop wallace关闭存储卷。gluster volume start wallace启动存储卷。
[root@servera ~]# gluster volume set wallace nfs.disable on
volume set: success
[root@servera ~]# gluster volume set wallace auth.allow 172.25.250.254
volume set: success
[root@servera ~]# gluster volume stop wallace
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
volume stop: wallace: success
[root@servera ~]# gluster volume start wallace
volume start: wallace: success
3.配置选项设置
gluster volume set gromit nfs.disable off关闭禁用nfs的功能。gluster volume set gromit nfs.rpc-auth-allow '172.25.250.*'允许对指定网络的文件输出设置规则。gluster volume set gromit nfs.rpc-auth-reject 172.25.250.254拒绝指定地址设置规则。
[root@servera ~]# gluster volume set gromit nfs.disable off
volume set: success
[root@servera ~]# gluster volume set gromit nfs.rpc-auth-allow '172.25.250.*'
volume set: success
[root@servera ~]# gluster volume set gromit nfs.rpc-auth-reject 172.25.250.254
volume set: success
4.配置挂载
mkdir /mnt/wallace创建挂载目录。echo "servera:/wallace /mnt/wallace glusterfs defaults 0 0" >> /etc/fstab将挂载信息写入配置文件。tail -1 /etc/fstab确认配置文件的写入内容。mount /mnt/wallace进行挂载。mount | grep wallace确认挂载。 df -Th | grep wallace查看文件系统。
[root@workstation ~]# mkdir /mnt/wallace
[root@workstation ~]# echo "servera:/wallace /mnt/wallace glusterfs defaults 0 0" >> /etc/fstab
[root@workstation ~]# tail -1 /etc/fstab
servera:/wallace /mnt/wallace glusterfs defaults 0 0
[root@workstation ~]# mount /mnt/wallace
[root@workstation ~]# mount | grep wallace
servera:/wallace on /mnt/wallace type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)
[root@workstation ~]# df -Th | grep wallace
servera:/wallace fuse.glusterfs 4.0G 66M 4.0G 2% /mnt/wallace
5.配置挂载
mkdir /mnt/gromit创建挂载目录。echo "servera:/gromit /mnt/gromit nfs rw 0 0" >> /etc/fstab将挂载信息写入配置文件。tail -1 /etc/fstab确认配置文件的写入内容。mount /mnt/gromit进行挂载。mount | grep gromit确认挂载。df -Th | grep gromit查看文件系统。
[root@servere ~]# mkdir /mnt/gromit
[root@servere ~]# echo "servera:/gromit /mnt/gromit nfs rw 0 0" >> /etc/fstab
[root@servere ~]# tail -1 /etc/fstab
servera:/gromit /mnt/gromit nfs rw 0 0
[root@servere ~]# mount /mnt/gromit
[root@servere ~]# mount | grep gromit
servera:/gromit on /mnt/gromit type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.25.250.10,mountvers=3,mountport=38465,mountproto=tcp,local_lock=none,addr=172.25.250.10)
[root@servere ~]# df -Th | grep gromit
servera:/gromit nfs 4.0G 65M 4.0G 2% /mnt/gromit
6.任务测评
lab clients-lab grade进行任务测评。主要包括:防火墙的配置,挂载目录,挂载配置,选项设置,挂载与取消挂载,存储卷可用等。
[student@workstation ~]$ lab clients-lab grade
Grading the student's work:
· Testing if all hosts are reachable.......................... SUCCESS
· Testing runtime firewall on servera for rpc-bind............ PASS
· Testing permanent firewall on servera for rpc-bind.......... PASS
· Testing runtime firewall on servera for nfs................. PASS
· Testing permanent firewall on servera for nfs............... PASS
· Checking for current mount on /mnt/wallace on workstation... PASS
· Checking if /mnt/wallace on workstation is in use........... PASS
· Unmounting /mnt/wallace..................................... PASS
· Mounting /mnt/wallace....................................... PASS
· Checking for current mount on /mnt/wallace on workstation... PASS
· Checking mount options for /mnt/wallace in /etc/fstab....... PASS
· Checking for current mount on /mnt/gromit on servere........ PASS
· Checking if /mnt/gromit on servere is in use................ PASS
· Unmounting /mnt/gromit...................................... PASS
· Mounting /mnt/gromit........................................ PASS
· Checking for current mount on /mnt/gromit on servere........ PASS
· Checking mount options for /mnt/gromit in /etc/fstab........ PASS
· Testing if workstation can mount gromit volume.............. PASS
· Testing if servere can mount wallace volume................. PASS
Overall lab grade.............................................. PASS