NFS Deployment and optimization

Source: Internet
Author: User

1. Installation of nfs-utils and Rpcbind programs

Yum install-y nfs-utils Rpcbind

2. Edit Exports

Vim/etc/exports


/mnt 10.10.13.248 (Rw,sync)

3. Install Nfs-utils on the client and view shared information

[email protected] ~]# Yum install-y nfs-utils

[Email protected] ~]# showmount-e 10.10.13.247

return results

Export list for 10.10.13.247:

/mnt 10.10.13.248

4. Mount on Client

[Email protected] ~]# mount-t NFS 10.10.13.247:/mnt/opt

5. Change permissions for shared directories on the server side

[Email protected] ~]# chmod 777/mnt

6. Create a file on the client

Cd/opt

Vim 1.txt

Successfully created

7. Restrict users ' permissions to shared folders

Edit the configuration file on the server side

Vim/etc/exports

Revision changed to

/mnt 10.10.13.248 (rw,sync,all_squash,anonuid=502,anongid=502)

Reload the configuration file on the server after modification

Exportfs-arv or restart service-side NFS Service

Reload after the client unloads the disk to view shared file permissions

[Email protected] opt]# Umount 10.10.13.247:/mnt

Mount-t nfs-onolock,nfsvers=3 10.10.13.247:/mnt/opt

[Email protected] opt]# cd/opt

[Email protected] opt]# ls-l

You can see that the created file belongs to the main group and becomes river

-rw-r--r--. 1 River 6 May 11:10 3.txt

8, do not limit the root sharing permissions

Service-side edit config file changed to

/mnt 10.10.13.248 (Rw,sync,no_root_squash)

Reload the configuration file Exportfs-arv

After the client unloads the disk and reloads the file, it can be found that the file belongs to the master group and becomes root.

-rw-r--r--. 1 root root 7 May 11:23 4.tx

This article is from the "愺 Burgundy pounding his 豩" blog, please be sure to keep this source http://riverxyz.blog.51cto.com/533303/1784734

NFS Deployment and optimization

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.