Linux Environment Deployment Record (ii)-NFS File Share

Source: Internet
Author: User

NFS File Sharing Service

Assuming that the existing two server IP addresses are 192.168.0.2 and 192.168.0.3,192.168.0.2, respectively, as server,192.168.0.3 as the client, then:

Both machines need to be installed Nfs-utils Rpcbind:

Yum Install nfs-utils rpcbindchkconfig NFS Onchkconfig rpcbind on

Turn on firewall ports 111 and 2049:

111 -J Accept111 -J Accept2049 -JAccept2049 -J ACCEPT/etc/init.d/iptables saveservice iptables Restart

Next, create a shared directory on 192.168.0.2:

mkdir -p/home/nfs

To modify an NFS configuration file:

VI /etc/exports

Add the following code:

192.168. 0.0/(rw,sync, Insecure,no_root_squash)

To start the NFS and RPC services:

Service Rpcbind StartService NFS Start

To view a native-published NFS shared directory:

Showmount-e  localhost

As a client 192.168.0.3, mount the server directory directly to the local directory after starting the service:

mkdir -p/home/nfs_serverMount192.168. 0.2:/home/nfs/home/nfs_server

To view file system mounts:

Tail -1 /etc/mtab

To set up automatic mounts:

vi /etc/fstab
#加入以下代码 192.168. 0.2:/home/nfs  /home/nfs_server   NFS  defaults,rw,_netdev  0   0

Linux Environment Deployment Record (ii)-NFS File Share

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.