Home >System Tutorial >LINUX >How to use NFS to implement flying pigeon transfer in Linux
Introduction | nfs is a network file system, which can realize file sharing between different hosts, just like Windows’ Network Neighborhood! How to implement this function in linux? It is also very simple to implement its function, just install the nfs package (redhat is installed by default) and configure its corresponding files! |
NFS server: 182.207.129.74
NFS client: 182.207.129.75 and 182.207.129.186
# rpm -q nfs-utils rpcbind
Note: RedHat 5.x checks portmap, redhat 6.x checks rpcbind
2. Configure the /etc/exports file on the NFS servervi /etc/exports
Then enter /home/cams/file 182.207.129.* (rw,sync,no_root_squash,no_all_squash)
Save and exit
3. Start rpcbind service# service rpcbind start 或者 service rpcbind restart4. Start nfs service
# service nfs start 或者 service nfs restart5. Query the NFS share status on the NFS server
# showmount -e6. Modify the attributes and user permissions of the NFS server-side mounted file
# chown -R cams:cams /home/cams/ # chmod -R 755 /home/cams/
At the same time, ensure that the uid and gid of each server user are consistent. Because the user already exists, modify the uid and gid.
# usermod -u 500 cams # groupmod -g 500 cams7. Query the NFS share status on the NFS client
# showmount -e NFS服务器IP8. Mount the shared directory on the NFS server on the NFS client
# mount NFS服务器IP:共享目录 本地挂载点目录 # mkdir -p /home/cams/file # mount 182.207.129.74:/home/cams/file /home/cams/file # mount | grep nfs
problem solved:
1. After mounting, both the user and user group are nobody
Modify the Domain item in the /etc/idmapd.conf file in the nfs server and client to be consistent. (If the server is not configured with a domain name, configure the domain name first and then restart the server)
The above is the detailed content of How to use NFS to implement flying pigeon transfer in Linux. For more information, please follow other related articles on the PHP Chinese website!