Introduction to using NFS to connect shared folders on centos for Mac
Network File System (NFS), a protocol used for distributed file systems, was developed by shengyang and published on September 10, 1984. The function is to allow different machines and operating systems to share individual data with each other through the network, so that applications can access data on server disks through the network on the client, it is a way to share disk files between UNIX systems.
The basic principle of NFS is "allow different clients and servers to share the same file system through a group of RPC", which is independent of the operating system, allows different hardware and operating system systems to share files.
NFS provides the following services:
- Search for files in the directory
- List files in a directory
- Manage directories
- Get the attributes of each file)
- File read/write
Wikipedia-Network File System
Centos Configuration
Use
rpm -qa|grep nfsrpm -qa|grep portmap
Two commands are used to check whether NFS is installed.
If the result is
[root@localhost ~]# rpm -qa|grep nfsnfs-utils-lib-1.0.8-7.2.z2nfs-utils-1.0.9-40.el5system-config-nfs-1.3.23-1.el5[root@localhost ~]# rpm -qa|grep portmapportmap-4.0-65.2.2.1
Two software packages nfs-utils Portmap are installed. If not, manually install
Configure/etc/exports
File:
/var/www 192.168.100.222(rw)
Format description:
[Directory to be shared] [IP address shared to client (option)] [client 2...
For detailed instructions on the configuration file, see: here
If centos prompts
nfsd: request from insecure port (192.168.7.130:49232)!
Configure the 'options'(rw,async,insecure)
You can.
Start (or restart) the NFS server (first Portmap and then NFS. Stop NFS when stopped. Portmap may be required by other services)
service portmap start(restart)service nfs start(restart)
Set the two services to start automatically when they are started.
chkconfig --level 35 portmap onchkconfig --level 35 nfs on
Change the permission of the folder to be shared as needed
chmod -R 777 /var/www
Mac Configuration
Use in a terminal
showmount -e IP\Domain
To view the sharing status of the centos host.
Run the command to mount the file.
$ sudo mount -t nfs 192.168.100.222:/var/www /private/nfs