Work, if you are using Server for NFS, you will experience modifications to the NFS server configuration, and if you want to re-load the modified configuration on the client,
But you can't restart the Rpcbind service, we need to use the Export command.
exportfs命令常用选项-a 全部挂载或者全部卸载-r 重新挂载-u 卸载某一个目录-v 显示共享目录以下操作在服务端上
Experiment: two sets of Centos7
vim /etc/exports
Increase
/tmp/ 192.168.133.0/24(rw,sync,no_root_squash)
exportfs -arv
The configuration file will take effect without restarting the NFS service
The NFS service cannot be restarted at random, and restarting the service will have an impact on the client that is mounting NFS.
Exportfs from Nfs-utils Bag
The function is to repair the configuration after overloading, without restarting the service.
Server:
[[email protected] nfsdir]# vim /etc/exports /home/nfsdir 172.16.22.0/24(rw,sync,all_squash,anonuid=1000,anongid=1000)/tmp 172.16.22.0/24(rw,sync,no_root_squash)[[email protected] nfsdir]# exportfs -arvexporting 172.16.22.0/24:/tmpexporting 172.16.22.0/24:/home/nfsdir
Client:
[[email protected] ~]# showmount -e 172.16.22.247 Export list for 172.16.22.247:/tmp 172.16.22.0/24/home/nfsdir 172.16.22.0/24[[email protected] ~]# mkdir /mnt/tmp[[email protected] ~]# mount -t nfs -onolock 172.16.22.247:/tmp /mnt/tmp -o nolock 了,即在挂载nfs服务时,不加锁。 在客户端上执行:[[email protected] ~]# touch /mnt/tmp/new.txt[[email protected] tmp]# ll /mnt/tmp/new.txt -rw-r--r-- 1 root root 0 Mar 16 01:41 /mnt/tmp/new.txt
Server:
[[email protected] nfsdir]# ll /tmp/new.txt -rw-r--r-- 1 root root 0 Mar 16 01:41 /tmp/new.txt[[email protected] mnt]# mount -t nfs -Oremount,nfsvers=3 172.16.22.247:/tmp /mnt/tmpmount.nfs: /mnt/tmp is busy or already mounted[[email protected] mnt]# umount /mnt/tmp/ [[email protected] mnt]# mount -t nfs -Oremount,nfsvers=3 172.16.22.247:/tmp /mnt/tmp
#NFS客户端问题: This issue occurs with NFS version 4
The client file belongs to the main genus group nobody
When a client mounts a shared directory, whether it is a root user or a normal user, a new file is created with the owner and group nobody
Add-o nfsvers=3 when client mounts
[[email protected] mnt]# mount -t nfs -Oremount,nfsvers=3 172.16.22.247:/tmp /mnt/tmpmount.nfs: /mnt/tmp is busy or already mounted[[email protected] mnt]# umount /mnt/tmp/ [[email protected] mnt]# mount -t nfs -Oremount,nfsvers=3 172.16.22.247:/tmp /mnt/tmp
Both the client and the server need
vim/etc/idmapd.conf//
Change "#Domain = local.domain.edu" to "Domain = xxx.com" (xxx.com here, define it arbitrarily), and then restart the RPCIDMAPD service
Server:
[[email protected] nfsdir]# vim /etc/idmapd.conf [General]#Verbosity = 0# The following should be set to the local NFSv4 domain name# The default is the host‘s DNS domain name.Domain = jamf.oceanwing.com[[email protected] nfsdir]# systemctl restart rpcidmapd客户端:[[email protected] mnt]# vim /etc/idmapd.conf [General]#Verbosity = 0# The following should be set to the local NFSv4 domain name# The default is the host‘s DNS domain name.Domain = zabbix.oceanwing.com[[email protected] mnt]# systemctl restart rpcidmapd
EXPORTFS Command and NFS client re-mount under NFS