In centos 6.2 and later versions, the Portmap service is changed to rpcbind. This is different from centos5 when NFS is used. an NFS system is configured below to allow all users in the LAN to access this directory, you can configure the directory as a yum source for the Intranet machine to install software.
First install the NFS suite. The command is as follows:
Yum install nfs-utils.x86_64 (64-bit System)
Yum install nfs-utils (32-bit System)
Then install the Portmap service. Portmap is renamed rpcbind in centos6.
Yum install rpcbind (centos6)
Yum install Portmap (centos5)
Configure NFS server
VI/etc/exports
Add
/Home/ABC 192.168.0.0/24 (RO, no_root_squash)
This line indicates that the local/home/ABC directory is the NFS shared directory, the accessible IP address range is 192.168.0.0-192.168.0.254, and the permission is read-only, when the visitor is a root user, the root permission is granted to access this directory.
Restart the NFS service
/Etc/init. d/rpcbind start
/Etc/init. d/nfs start
Add NFS to startup Item
Chkconfig NFS on
Client Configuration
Check whether the NFS service can be accessed
Showmount-e 192.168.0.10
Shown as follows:
Export list for 192.168.0.10:
/Opt/centos6 192.168.0.11
Indicates that access is allowed. If not, check whether the NFS service is enabled on the NFS server and whether the firewall is allowed to pass.
Mount the NFS Directory
Mkdir/opt/centos6
Mount-t nfs 192.168.0.10:/opt/centos6 // opt/centos6/
Configure Automatic mounting upon startup (this is generally not the case in the actual production environment and may be caused by network issues)
VI/etc/fstab
Add
192.168.0.10:/opt/centos6/opt/centos6 NFS nodev, Ro, rsize = 32768, wsize = 32768 0 0
========================================================== ==========================================================
Configure the NFS service.
NFS Introduction
NFS stands for Network File System. The Network File System was first developed by Sun. Its function is to share files between different machines and operating systems. The port used for data transmission over NFS is a random port.
RPC: Remote process call. Its function is to specify the port number corresponding to each NFS function. When the NFS server is started, it will randomly enable several port numbers and actively register with RPC, so that RPC will know the function of each port number, RPC uses port 111 to listen to the client's request and respond to the correct port number.
You must start RPC before starting NFS. Otherwise, NFS cannot register with rpc. When RPC is restarted, data on the previously registered port will be lost, all programs it manages must be registered with RPC again.
How NFS works
1) the client sends an RPC request to the remote NFS server.
2) the NFS server uses the Portmap or rpcbind service to query the working port of NFS. (Centos5 is portmat and 6 is rpcbind)
3) The client contacts the partition to be loaded, and the server will verify whether the client has the right to load.
4) The client updates the mtab file, indicating that the file is successfully loaded.
Basic NFS configuration
Check whether the software is installed:
[Root @ rhel2 ~] # Rpm-Qa | grep NFS
Nfs-utils-1.0.9-40.el5
Nfs-utils-lib-1.0.8-7.2.z2
[Root @ rhel2 ~] # Rpm-Qa | grep protmap (note centos6. Change to rpm-Qa | grep rpcbind)
[Root @ rhel2 ~] # Rpm-IVH/MISC/CD/Server/portmap-4.0-65.2.2.1.i386.rpm
Preparing... ######################################## ### [100%]
Package portmap-4.0-65.2.2.1.i386 is already installed
The software has been installed.