NFS Network File System building what is an NFS network file system?
The NFS (Network File system), which is one of the file systems supported by FreeBSD, allows computers in the network to share resources across TCP/IP networks. In an NFS application, a local NFS client application can transparently read and write to files located on the remote NFS server, just as you would access a local file.
In Linux, NFS is used primarily for network data sharing. NFS network files are typically used to store static resource files, such as shared video screens, pictures, attachments, and so on.
Because NFS ports are not fixed in Linux, it is difficult to determine which ports are used by NFS. Therefore, RPC protocol is needed to play the role of client and server broker.
How do I configure the NFS service?
When a user accesses a file for an NFS server, the RPC service is required to locate the Port for NFS, and a port is available to fetch the local disk that accesses NFS.
1, server-side and client-initiated RPC service (C5:PORTMAP, C6:rpcbind) 2, server-side start NFS service. 3, the client requests the NFS service. 4. The RPC service returns the appropriate NFS port to the client. 5. The client has an NFS port to locate the NFS service. Turn on NFS Packages
You need at least two packages, one for the main package nfs-utils for NFS, and one for the RPC service Package Rcpbind (C6).
The specific implementation process is as follows.
Share the/data folder on the remote NFS server.
Service side:
Check the system version number, NFS, and RPC services.
[Email protected] ~]# cat/etc/redhat-release CentOS Release 6.6 (Final) [Email protected] ~]# Rpm-qa nfs-utils protmap rpcbind Rpcbind-0.2.0-12.el6.x86_64 Nfs-utils-1.2.3-70.el6_8.2.x86_64 [[Email protected] ~]# service iptables stop [Email protected] ~]# chkconfig iptables off |
To check for NFS packages or RPC service packs, you need to install the Nfs-util package and the Rpcbind package or install the NFS File System Package group directly
[email protected] ~]# Yum install nfs-util rpcbind-y [email protected] ~]# Yum groupinstall "NFS file System" –y Edit the NFS configuration file. /etc/exprots file. [email protected] ~]# cat >>/etc/exports <<eof > #shared data for BBS by Alin 20161214 >/data 192.168.113.0/24 (Rw,sync) > EOF |
Turn on the RPC service and restart or smooth restart the NFS service.
[Email protected] ~]#/etc/init.d/rpcbind restart [Email protected] ~]#/etc/init.d/nfs Reload [Email protected] ~]#/etc/init.d/nfs restart |
Check whether the configuration was successful.
[Email protected] ~]# showmount-e localhost Export list for localhost: /data 192.168.113.0/24 |
Set up RPC Protocol and NFS service for permanent boot
[Email protected] ~]# chkconfig rpcbind on [[email protected] ~]# chkconfig NFS on |
Client:
Check the system version, the RPC service pack, and start the RPC service.
[Email protected] ~]# cat/etc/redhat-release CentOS Release 6.6 (Final) [Email protected] ~]# uname-a Linux moban 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 04:27:16 UTC x86_64 x86_64 x86_64 gnu/linux [Email protected] ~]# Rpm-qa Rpcbind Rpcbind-0.2.0-12.el6.x86_64 [Email protected] ~]#/etc/init.d/rpcbind restart |
See if NFS services are turned on at the remote.
[Email protected] ~]# showmount-e 192.168.113.131 Export list for 192.168.113.131: /data 192.168.113.0/24 |
Mount the/data folder of the remote server to the local/mnt.
Format: mount–t [File type] [Destination IP Address: Destination folder] [local folder]
[Email protected] ~]# mount-t NFS 192.168.113.131:/data/mnt |
Change the/data owner group on the server side and read and write tests on the client.
[Email protected] ~]# chown Nfsnobody.nfsnobody/data [email protected] mnt]# Touch clientNFStest.txt [email protected] mnt]# ll NfsTest.txt -rw-r--r--1 nfsnobody nfsnobody 0 Dec 3 18:52 nfsTest.txt |
Test success! Finally, the Mount NFS server on boot is set to boot from boot.
[email protected] mnt]# cat >>/etc/rc.local<<eof > #nfs/data dir > Mount-t NFS 192.168.113.131:/data/mnt > EOF [Email protected] mnt]# Tail-2/etc/rc.local #nfs/data dir Mount-t NFS 192.168.113.131:/data/mnt |
This article is from the "Alin Small rookie" blog, please be sure to keep this source http://9342576.blog.51cto.com/9332576/1879308
NFS Network File system build-up