RHEL6.4NFS file sharing server Construction

Source: Internet
Author: User
RHEL6.4NFS file sharing Server SETUP read: Ubuntu12.04 install NFSserverhttp: // configure

RHEL6.4 create an NFS file sharing Server

Related reading:

Ubuntu 12.04 installing NFS server http://www.linuxidc.com/Linux/2012-09/70728.htm

NFS Server Installation configuration for Ubuntu 12.04 and ARM file sharing http://www.linuxidc.com/Linux/2012-10/73159.htm

Build nfs server http://www.linuxidc.com/Linux/2012-10/71930.htm in Ubuntu

File Server NFS configuration details http://www.linuxidc.com/Linux/2013-06/86542.htm

Build NFS Network File System server http://www.linuxidc.com/Linux/2013-07/87367.htm under Ubuntu

Heartbeat_ldirector + LB + NFS implement HA and LB, file sharing http://www.linuxidc.com/Linux/2013-06/85292.htm

CentOS 5.5 Configure NFS server tutorial http://www.linuxidc.com/Linux/2013-03/81737.htm

Http://www.linuxidc.com/Linux/2013-03/80478.htm for NFS installation in Ubuntu 12.10


1. Experiment plan

Use two RHEL6.4 virtual machines, one of which serves as the NFS Shared Server (192.168.100.1) and the other as the NFS client for testing (192.168.100.2)

2. Implementation

2. 1. Configure the NFS Shared Server.

1) install the software package and create a shared directory.

[Root @ nfs-server ~] # Rpm-q rpcbind nfs-utils

Rpcbind-0.2.0-11.el6.x86_64

Nfs-utils-1.2.3-36.el6.x86_64

[Root @ nfs-server ~] # Mkdir/nfstest

[Root @ nfs-server ~] # Echo "test file">/nfstest/nfs.txt // create a test file

[Root @ nfs-server ~] # Ls-ld/nfstest // view test directory permissions

Drwxr-xr-x. 2 root 4096 Apr 14/nfstest

2) modify the nfs master configuration file/etc/exports and add/nfstest sharing settings.

[Root @ nfs-server ~] # Vim/etc/exports

[Root @ nfs-server ~] # Cat/etc/exports

/Nfstest 192.168.100.2 (rw, sync, no_root_squash) // set to read and write only to 192.168.100.2 users, and write data to the memory and hard disk synchronously. Open the client to use the root identity.

3) Enable NFS-related service programs.

After the rpcbind and nfs services are started successfully, run showmount-e to view the list of shared resources currently released on the local machine:

[Root @ nfs-server ~] # Service rpcbind start

[Root @ nfs-server ~] # Service nfs start

[Root @ nfs-server ~] # Chkconfig rpcbind on // set the startup Service

[Root @ nfs-server ~] # Chkconfig nfs on

[Root @ nfs-server ~] # Chkconfig -- list rpcbind // make sure the service is started

Rpcbind 0: off1: off2: on3: on4: on5: on6: off

[Root @ nfs-server ~] # Chkconfig -- list nfs

Nfs 0: off1: off2: on3: on4: on5: on6: off

[Root @ nfs-server ~] # Showmount-e localhost // view local shared resources

Export list for localhost:

/Nfstest 192.168.100.2

2.2 Use the NFS client to view and access/nfstest sharing.

1) The client also needs to install the corresponding software

[Root @ client01 ~] # Rpm-q rpcbind nfs-utils

Rpcbind-0.2.0-11.el6.x86_64

Nfs-utils-1.2.3-36.el6.x86_64

2) view the NFS shared resource list of the server from the client.

The nfs-utils package must be installed on the client to view NFS resources using the showmount command:

[Root @ client01 ~] # Showmount-e 192.168.100.1

Export list for 192.168.100.1:

/Nfstest 192.168.100.2

3) Mount/nfstest share on client 192.168.100.2 and test the read/write permission.

[Root @ client01 ~] # Mount 192.168.100.1:/nfstest/mnt // mount the shared directory to the local mnt directory

[Root @ client01 ~] # Cd/mnt; ls

Nfs.txt

[Root @ client01 mnt] # cd

[Root @ client01 ~] # Cd/mnt; ls

Nfs.txt

[Root @ client01 mnt] # touch aa.txt // test write permission

[Root @ client01 mnt] # ll

Total 4

-Rw-r --. 1 root 0 Apr 14 07:40 aa.txt

-Rw-r --. 1 root 10 Apr 14 07:18 nfs.txt

4) Configure to automatically mount NFS shared resources after the instance is started.

[Root @ client01 ~] # Vim/etc/fstab

192.168.100.1:/nfstest/mnt nfs ults 0 0 // the file type is nfs

[Root @ client01 ~] # Umount/mnt

[Root @ client01 ~] # Mount-

[Root @ client01 ~] # Mount | tail-n 1

192.168.100.1:/nfsteston/mnt type nfs (rw, vers = 4, addr = 192.168.100.1, clientaddr = 192.168.100.2) // automatic mounting upon startup successful

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-05/101165.htm

Related Article

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.