NFS installation and configuration on Linux

Source: Internet
Author: User


NFS installation and configuration on Linux is short for Network File System, that is, Network File System. NFS allows a system to share directories and files with its users on the network. By remotely mounting NFS, users and programs can access files on the remote system just like accessing local files.
However, according to my past experience, when NFS is not frequently accessed, a server with better configuration can meet the usage requirements. After the PV volume reaches the level of 1 million a day, NFS has become the biggest performance bottleneck and single point of failure in the entire system. Therefore, it is strongly recommended that distributed file systems such as moosefs and lustre be used after the access Traffic reaches a certain level; if cost is not taken into account, expensive NAS devices such as IBM or HP can be used. The installation and configuration of NFS on Linux are explained under www.2cto.com. 1. RHEL/SUSE: # rpm-ivh nfs-utils-lib-* # rpm-ivh nfs-utils-* # rpm-ivh nfs4-acl-tools-* # rpm-ivh portmap-* CentOS: # yum install nfs-utils nfs4-acl-tools portmap Ubuntu: # apt-get install nfs-common nfs-kernel-server portmap www.2cto.com 2. configure the NFS server to share some directories on the output server so that the NFS client can mount and access # vi/etc/exports/data/nfshome/common 192.168.10.0/255.255.255.0 (rw, sync) /data/nfshome/private 192.168.10.4 (rw, sync, no _ Root_squash) 192.168.10.5 (rw, sync, no_root_squash)/data/nfshome/public * (ro, sync) related annotations are as follows: the first rule/data/nfshome/common directory is open to all hosts with 192.168.10.x. The permission is rw read/write and sync file synchronization; the second rule/data/nfshome/private directory is open to hosts 192.168.10.4 and 192.168.10.5 with the permission to read/write rw and sync files, no_root_squash enables the root user to have full management access permissions to the root directory. The third rule/data/nfshome/public directory is open to all hosts, With the permission ro read/write and sync file synchronization. Below are some common NFS sharing parameters: ro // read-only access rw // read/write access sync // write all data to the shared async upon request // NFS can respond to the request wdelay before writing data // if multiple users want to write NFS Directory, group write (default) no_wdelay // if multiple users want to write to the NFS Directory, write immediately. This setting is not required when async is used. Hide // do not share its subdirectory no_hide in the NFS shared directory // The subdirectory no_subtree_check of the shared NFS directory is opposite to the above, do not check the permission of the parent directory all_squash // map the UID and GID of the shared file to the anonymous user anonymous, which is suitable for public directories. No_root_squash // the root user has full management and access permissions for the root directory www.2cto.com. Set NFS service to start from startup # chkconfig nfs on # chkconfig portmap on start NFS service #/etc/init. d/portmap start #/etc/init. d/nfs start 3. configure NFS client remote access to check whether the NFS server has a directory share (assuming the Server IP address is 192.168.10.3) # showmount-e 192.168.10.3/data/nfshome/public */data/nfshome/private 192.168.10.4 192.168.10.5/data/nfshome/common 192.168.10.0/255.255.255.0 www.2cto.com mount the NFS shared directory # mount-t nfs- o rw, tcp, intr 192.168.10.3:/data/nfshome/private/mnt/nfs check whether mounting is successful # df-h settings/etc/fstab enable automatic mounting upon startup # vi/etc/fstab192.168.10.3: /data/nfshome/private/mnt/nfs rw, tcp, intr

Related Article

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.