How to build an NFS server

Source: Internet
Author: User

How to build an NFS server
1. Install NFS server 1.1

RPC main program: rpcbind

NFS main program: nfs-utils

[Root @ ~] #Rpm-qa | grep rpcbind

[Root @ ~] #Rpm-qa | grep nfs

1.2 NFS security configuration

Firewall settings, bind the NFS service port

[Root @ ~] #Vi/etc/sysconfig/nfs

RQUOTAD_PORT = 875

LOCKD_TCPPORT = 32803

LOCKD_UDPPORT = 32769

MOUNTD_PORT = 892

STATD_PORT = 662

Configure the firewall policy to enable the above ports and111, 2049Port (111 is the RPC port number, and the NFS service is started on port 2049.

1.3 Construction

1) configuration file/etc/exports

[Root @ ~] #Vi/etc/exports

/Wserp/repos * (rw, sync)

2) Start rpcbind, nfs, and nfslock

Service xxxstatus/start (/etc/init. d/xxx)

3) set rpcbind, nfs, and nfslock to start at startup.

Chkconfig xxx on

1.4 Test

View connections

[Root @ ~] #Showmount-e xxx

1.5 Other Instructions

1) After resetting the/etc/exports file, you do not need to restart NFS.

# A. Re-mount the setting of/etc/exports once

[Root @ ~] #Exportfs-arv

# B. unmount all shared NFS directory resources

[Root @ ~] #Exportfs-auv

2) Precautions for shutdown

When the RPC service used by NFS is connected to the server on the client, it may take several hours to shut down the server. Before the NFS Server is shut down, we recommend that you turn off the two daemon: rpcbind and nfs. If not, kill them.

2. Set up NFS client 2.1

Start required services rpcbind and nfslock. See section 1.3.

2.2 mount and unmount

1) create a mount point and mount it

[Root @ ~] #Mount-t nfs IP:/dir

View the information after mounting

[Root @ ~] #Df

2) uninstall

[Root @ ~] #Umount dir

3) start mounting

Edit File/Etc/rc. d/rc. localAdd the mount command.

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.