Author: SpookZanG
Build an NFS server in linux
I. What is an NFS service?
NFS is short for Network File System, that is, Network File System.
The Network File System is one of the file systems supported by FreeBSD, also known as NFS. NFS allows a system to share directories and files with others on the network. By using NFS, users and programs can access files on the remote system just like accessing local files.
Ii. Advantages of NFS
1. The local workstation uses less disk space because the data can be stored on a machine and accessed over the network.
2. You do not have to have a home directory in each machine on the network. The Home directory can be placed on the NFS server and is available everywhere on the network.
3. storage devices such as soft drive, CDROM, and Zip & reg; can be used by other machines on the network. This reduces the number of removable media devices on the network.
NFS has at least two main parts: one server and one (or more) client. The client remotely accesses the data stored on the server. To work properly, some processes need to be configured and run.
Iii. NFS Construction
1. Server Side
Install the NFS service program
Yum install-y nfs-utils
Write configuration file
Vim/etc/exports
Write
/Music 192.168.0.0/255.255.255.0 (rw, sync)
Format:
IP address and mask or domain name shared by the Directory to be shared (permission, synchronous update)
Start the service
/Etc/init. d/portmap restart
/Etc/init. d/nfs restart
Chkconfig nfs on
Chkconfig portmap on
Disable the firewall and change Selinux's NIS options.
/Etc/init. d/iptables stop (Firewall Service Disabled)
Chkconfig iptables off
System-config-selinux (set selinux)
2. Client
Edit the fstab file to enable automatic mounting upon startup
Mount-t nfs IP:/directory to the mounted directory (this is a temporary mount)
For example, mount-t nfs 192.168.0.9:/doce/doc
Edit the FSTAB file
Vim/etc/init. d/fstab
IP: // directory mounted to nfs ults 0 0
Disable the firewall and change Selinux's NIS options.
/Etc/init. d/iptables stop (Firewall Service Disabled)
Chkconfig iptables off
System-config-selinux (set selinux)
So far, the building is complete.