NFS Service configuration under Linux

Source: Internet
Author: User

NFS = = Network File system, which implements read and write files through network communication


Need to have a server-side and client-side communication form, the machine can access the remote machine files

There is a B C three machines, on a To do an NFS, so that B and C can access to synchronize the sharing of files


Steps:

Service-Side IP 192.168.174.128

Download Yum install-y nfs-utils rpcbind (Rpcbind used for communication between client and server side)

Vim/etc/exports

Write/mnt 192.168.174.129 (rw,sync): Mount the file system to the/MNT directory, making the client machine readable and writable


Start Rpcbind and NFS:

/etc/init.d/rpcbind start

/etc/init.d/nfs start


Go to the client:

Download installation Nfs:yum Install Nfs-utils

SHOWMOUNT-E 192.168.174.128

Mount the directory shared by the server to the client's/OPT directory: mount-t NFS 192.168.174.128:/mnt/opt


It means that if I want to read and write to the shared directory, then the remote directory must be used as part of this machine, the user can directly contact; After the mount, you can also see the NFS directory df-h, and the file system type is NFS; Files created in the shared directory are mapped by the owner and the group is nfsnobody, but can also go to the free to specify the mappings of the owner and the group


Go to the service side:

Change the permissions of the/MNT directory to 777


Go to the client:

You can create a file under/opt, with no restrictions on permissions

[[email protected] opt]# Touch 1.txt


Service side:

Specify both user and group for all users to be 501:

/mnt 192.168.174.129 (rw,sync,all_squash,anonuid=501,anongid=501)

Two ways to restart:

/etc/init.d/nfs restart

Exportfs-arv


Do not restrict the root user to the client:

The client creates the file as root, so the user and group of the file should also be root; Not to limit root

/mnt 192.168.174.129 (Rw,sync,no_root_squash)


Client:

Uninstall First: umount/opt

To mount again, you need to specify that the NFS version is 3:mount-t nfs-onolock,nfsvers=3 192.168.174.128:/mnt/opt

If the NFS version is 4, the user is mapped to the Nfsnobody


This article is from the "Parody Games" blog, so be sure to keep this source http://kevinjin117.blog.51cto.com/11655131/1843598

NFS Service configuration under Linux

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.