NFS Service Configuration Chapter

Source: Internet
Author: User

Installing and configuring NFS Services
1.NFS Introduction
NFS (Network File system)
NFS is a file system that hosts a directory file over a network that allows other host B to share host A.
2. Need to install two packages Nfs-util and Rpcbind
When installing Nfs-utils, the Rpcbind will be installed automatically
3. Modify the configuration file Vim/etc/exports
Configuration file Total three parts
/HOME/192.168.137.0/24 (rw,sync,all_squash,anonuid=501,anongid=501)
(1) Part one: directories to be shared locally
(2) Part two: which host to allow remote, can have multiple hosts to share
(3) Part III: Permission entries. For read-write, synchronization, all users are qualified, and the qualified UID and GID are all 501.
Note: Here the UID and GID are host A's
4.NFS Configuration Instructions
RW: Read and write;
RO: Read only;
Sync: Synchronous mode, in-memory data is always written to disk;
Async: Out-of-sync, write in-memory data to disk on a regular basis;
No_root_squash: With this option, the root user has high control over the shared directory, as if it were a native directory operation. Unsafe, not recommended for use;
Root_squash: And the above options correspond to the root user permissions on the shared directory is not high, only the normal user's permission, that is, limit the root;
All_squash: Regardless of the user who uses NFS, his identity will be limited to a designated ordinary user identity;
Anonuid/anongid: To be used with Root_squash and All_squash to specify a user-defined UID and GID using NFS, provided the UID and GID exist in the/etc/passwd of this machine.
Note: Anonuid and anongid are generally used in conjunction with All_squash/root_squash.
When using All_squash Anonuid/anonid, when the client shared directory creation file, found that the owner of the file, belong to the group and the service host that directory owner, belong to the same group. This is the result of squash.

Last start service/etc/init.d/rpcbind Start/etc/init.d/nfs start

4. Mount NFS on the client
The client also installs the Yum install-y nfs-utils
See which directories are shared on the server side
SHOWMOUNT-E 192.168.137.10
Mount NFS on the client side of the server
Mount-t nfs-onolock,nfsvers=3 192.168.137.10:/home//mnt///If you do not add-onolock,nfsvers=3 the file owner and group in the Mount directory are nobody, if you specify NFSV ERS=3 Displays the root

Df-h viewing the Mount situation

5. Use of the EXPORTFS command
-A: Mount or uninstall all;
-R: Re-mount;
-U: Uninstalls a directory;
-V: Show shared Directories
After changing the/etc/exports configuration file, do not restart the NFS service directly with this EXPORTFS
Exportfs-arv make effective
When using NFS, one of the most common options is-o nolock
We can also write the NFS directory you want to mount to the/etc/fstab file on the client 192.168.137.10:/tmp//test NFS nolock 0 0 then Mount–a

Extension section:

Encountering an issue that cannot be umount:

[Email protected]:/# umount/data1/nfs/
Umount.nfs:/data1/nfs:device is busy
Umount.nfs:/data1/nfs:device is busy
(1) When encountering this problem, only need to use the fuser command to solve:

[Email protected]:/# fuser-km/data1/nfs/
[Email protected]:/# fuser-f/data1/nfs/
After performing the above operation, then go to Umount. Fuser the meanings of several parameters used above are as follows:

http://www.361way.com/nfs-mount-nobody/2616.html

(2) Nobody problem:

Http://www.361way.com/nfs-mount-nobody/2616.html

http://www.cnblogs.com/taosim/articles/3913075.ht

NFS Service Configuration Chapter

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.