Build an NFS server in Linux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.