需求:file01:1.1.1.1(内网ip 172.20.103.212),file02:2.2.2.2(内网ip 172.20.103.211) 这两台机器的 /dev/mapper/myvg-mylv /data 这个盘都挂载到 video01 47.254.78.171, video02 47.254.83.81 这两台机器上即将file01和file02的/data目录都挂载到video01和video02上处理:file01和file02安装yum install -y exportfs nfs-utilsvideo01和video02安装yum install -y nfs-utils1.在file01和file02添加共享的文件夹和客户端可以访问的IP地址[root@eus_filmora_file01:~]# vim /etc/exports/data *(insecure,rw,no_root_squash,sync,anonuid=500,anongid=500)# 查看共享文件夹[root@eus_filmora_file01:/data]# exportfs -rvexporting *:/data # 重启file01的NFS服务 systemctl restart nfs 2.目标机器video01和video02上创建挂载点并挂载# 客户端video01和video02操作mkdir /file01_nfsmkdir /file02_nfs# 挂载file01和file02mount -t nfs 172.20.103.212:/data /file01_nfs -o proto=tcp -o nolockmount -t nfs 172.20.103.211:/data /file02_nfs -o proto=tcp -o nolock# 卸载nfs[root@eus_filmora_video01:~]# umount 172.20.103.212:/data列出nfs服务端共享的目录:[root@eus_filmora_video01:/file02_nfs]# showmount -e 172.20.103.212Export list for 172.20.103.212:/data *[root@eus_filmora_video01:/file02_nfs]# showmount -e 172.20.103.211Export list for 172.20.103.211:/data *# 添加开机自动挂载[root@eus_filmora_video01:~]# cat /etc/rc.local #!/bin/bashmount -t nfs 172.20.103.212:/data /file01_nfs -o proto=tcp -o nolockmount -t nfs 172.20.103.211:/data /file02_nfs -o proto=tcp -o nolock报错:mount: wrong fs type, bad option, bad superblock on 10.25.177.47:/opt/data07, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.helper program) In some cases useful info is found in syslog - try dmesg | tail or so.解决:yum install -y nfs-utils报错:mount.nfs: access denied by server while mounting 10.25.177.47:/data/voice 解决:nfs服务端 vim /etc/sysconfig/nfs修改如下:RPCNFSDARGS="-N 2 -N 3" ----->启用# Turn off v4 protocol supportRPCNFSDARGS="-N 4" ---->启用重启生效systemctl restart nfs