Ruijie Network Skills Competition-Cloud Platform Part-CentOS Part 02-[NFS]
Disclaimer: Writing articles about these competitions is just to facilitate the learning of motivated students in some areas. The blogger himself is just out of good intentions. Therefore, the blogger has no obligation to personal service, not to mention not getting a penny. The reason for this is because Some of the classmates who asked me to ask questions had a bad attitude, so I deleted a lot of my personal contact information. The competition itself has nothing to do with me. It is only related to your own personal learning ability, and you can’t understand me. There is no relationship, those who understand will naturally understand, I tried my best, you are free!
It can’t be solved. Of course I can also provide some paid services.
Reason 1: Too many people ask me.
Reason 2: Some students are not so high-quality
NFS
Sample question content
The parts and questions of NFS in the 2019 national competition sample questions are as follows: 3 sets of questions
2019 Volume A
ServerA
Configure NFS service
- Shared directory /data/web_data, shared with read and write permissions
- Shared target: 192.168.1XX.0/24
ServerB
- Configure NFS service
- Edit the /etc/fstab configuration file to automatically mount the NFS share of serverA to the /data/web_data directory
- The system will automatically stop the mount operation when the network is unavailable during system startup
# 关闭防火墙和SELINUX
# ServerA
yum install nfs-utils
systemctl start rpcbind
systemctl start nfs
# 服务端配置共享目录
mkdir -pv /data/web_data
chmod 755 /data/web_data
vim /etc/exports
/data/web_data/ 192.168.1XX.0/24(rw,sync,no_root_squash,no_all_squash)
# /data/web_data/: 共享目录位置。
# 192.168.1XX.0/24: 客户端 IP 范围,* 代表所有,即没有限制。
# rw: 权限设置,可读可写。
# sync: 同步共享目录。
# no_root_squash: 可以使用 root 授权。
# no_all_squash: 可以使用普通用户授权。
systemctl restart nfs
# 检查本地的共享目录
showmount -e localhost
# ServerB
systemctl start rpcbind
# 客户端不需要打开防火墙,因为客户端时发出请求方,网络能连接到服务端即可。
# 客户端也不需要开启 NFS 服务,因为不共享目录。
# 查看服务端的共享目录
showmount -e 192.168.1XX.22
mkdir -pv /data/web_data
mount -t nfs 192.168.1XX.22:/data/web_data /data/web_data # 挂载
#mount -t nfs 192.168.10.22:/data/web_data /data/web_dat
mount # 查看
vim /etc/fstab
192.168.1XX.22:/data/web_data /data/web_data nfs defaults,_rnetdev 0 0
# 重新加载 systemctl
systemctl daemon-reload
##挂载 ###一般不考 如果设置了权限考
nfs4_setfacl -a A::1001:rwx /data/web_data/
Configure NFS service
- Shared directory /data/web_data, shared with read and write permissions
- Shared target: 192.168.1XX.0/24
[root@serverA ~]# systemctl start rpcbind
[root@serverA ~]# systemctl start nfs
[root@serverA ~]# chmod 755 /data/web_data
[root@serverA ~]# vim /etc/exports
[root@serverA ~]# cat !$
cat /etc/exports
/data/web_data/ 192.168.110.0/24(rw)