Deploying NFS Services under Linux

Source: Internet
Author: User
Tags iptables

Deploying NFS Services under Linux

General application Scenario: The server side allocates shared disk space, is mounted by one or more clients to achieve data sharing, centralized management and maintenance, access control and so on.

Steps:

Server Side-CentOS 7

    • Install the necessary packages: Nfs-utils, Rpcbind
      yum -y install nfs-utils
      yum -y install rpcbind
    • Configuring the Etc/exports File
      Exports configuration of the parameter options are more, specific details with man to see and understand. Here is a description of the main 4 parameters:

All_squash : No matter what account the client uses to create the data, the owner is Nfsnobody
No_all_squash : Only the data created by the client with the root account, the owner is nfsnobody, the data created by other users is owned by other users themselves
Root_squash : Only the data created by the client with the root account is nfsnobody, and the data created by other users is owned by other users themselves.
No_root_squash : The root user has full access, and any user-created owner is the owner
为exports文件里的内容,红色区域为客户端的IP地址

    • Let the NFS configuration file take effect. (Note: This step is required for each update made to/etc/exports)
      exportfs -rv

      -R #重新共享所以目录
      -V #输出详细信息

    • Shutting down the firewall
      iptables -F
      systemctl stop firewalldOrsystemctl disable firewalld
    • Modify the/etc/selinux/config file to let selinux=disabled
      vim /etc/selinux/config
      SELINUX=disabled
      setenforce 0
    • Start the appropriate service
      systemctl start rpcbind
      systemctl start nfs-utils
      systemctl start nfslock

Client

    • Install the necessary package Nfs-utils, Rpcbind
      yum -y install nfs-utils
      yum -y install rpcbind
    • Shutting down the firewall
      iptables -F
    • Modify the/etc/selinux/config file to let selinux=disabled
      vim /etc/selinux/config
      SELINUX=disabled
      setenforce 0
    • Use the mkdir command to create the necessary mount directory, for example:
      mkdir /mnt/nfs
    • To view NFS information shared by the server, use the command showmount
      SHOWMOUNT-E server_ip
    • Use the Mount command to mount the server's shared directory, for example:
      Mount-t NFS ServerIP:/nfs/mnt/nfs
    • Use df-th to verify Mount status
      df -Th

Deploying NFS Services 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.