System environment: Oracle Linux 5.7
Service side: 192.168.1.111
Client: 192.168.1.171
First, the service-side configuration
1. Start Portmap and NFS services in turn
Service Portmap Start
Service NFS Start
[[email protected] ~]# service Portmap statusportmap (PID 2543 ) is running ... [[email protected] -asm ~]# service NFS Statusrpc.mountd is STOPPEDNFSD Stoppedrpc.rquotad is stopped[[email protected] -asm ~]# Service NFS Startstarting NFS Services: [OK]starting NFS Quotas: [OK] Starting NFS Daemon: [OK]starting NFS Mountd: [OK]
[Email protected] ~1053010527105261052510524 1052310522105211052010504) is running ...
2. Configure the directory that the server needs to share to the/etc/exports file
For example, add a line to the/etc/exports configuration file:
/USR2/NFS * (rw)
Restart the NFS service after configuring the/etc/exports file
[Email protected]/]#mkdir-p/usr2/Nfs[[email protected]-asm/]# cd/usr2/Nfs[[email protected]-asm nfs]#ls[[Email protected]-asm nfs]#pwd/usr2/Nfs[[email protected]-asm nfs]#Touch 1 2[[Email protected]-asm nfs]#VI 1[[Email protected]-asm nfs]#VI 2[[Email protected]-asm nfs]# More 1Hello, World! one~[[Email protected]-asm nfs]# More 2Hello, World!Both . [[Email protected]-asm nfs]#pwd/usr2/Nfs[[email protected]-asm nfs]#ls-Lhtotal8. 0K-rw-r--r--1Root root + Ten- the Ten: Geneva 1-rw-r--r--1Root root + Ten- the Ten:Geneva 2
[Email protected] nfs]#VI/etc/exports[[Email protected]-asm nfs]# More/etc/exports/USR2/NFS *(rw)[[Email protected]-ASM nfs]# Service NFS restartshutting down NFS mountd: "OK]shutting down NFS Daemon: [OK] Shutting down NFS quotas: [OK]starting NFS Services: [OK] Starting NFS Quotas: [OK]starting NFS Daemon: [OK] Starting NFS mountd: [OK]
[[Email protected]-asm nfs]# Showmount-Eexport List foroel-ASM:/USR2/NFS *[[Email protected]-ASM nfs]# Exportfs/usr2/nfs <world>
Second, the client configuration
1. Also start the service
Service Portmap Start
Service NFS Start
2. Create mount directory mount server-mapped directory
mkdir -p/usr2/nfs_mapMount192.168. 1.111:/usr2/nfs/usr2/nfs_map
In this case, you can see the file under the server/usr2/nfs directory under the client/usr2/nfs_map directory, as follows:
#DF-hfilesystem Size used Avail use%mounted on/dev/mapper/volgroup00-LogVol00 55G 11G 41G +%//dev/sda1 99M 23M 71M -% /Boottmpfs 749M0749M0%/dev/SHM192.168.1.111:/usr2/NFS 55G 11G 41G +%/usr2/Nfs_map#ls-Lhtotal8. 0K-rw-r--r--1Root root + Ten- the Ten: Geneva 1-rw-r--r--1Root root + Ten- the Ten:Geneva 2
# More 1Hello, World! one~
# More 2Hello, World! Both.
Linux NFS Service Deployment