Linux Server Setup-nfs

Source: Internet
Author: User

NFS:NFS, the network file system, is one of the file systems supported by FreeBSD that allows computers in the network to share resources across TCP/IP networks. In an NFS application, a local NFS client application can transparently read and write to files located on the remote NFS server, just as you would access a local file.

Environment: CentOS 6.5

first, server-side configuration:
Packages required to install server for NFS: Nfs-utils and Rpcbind
# yum Install Nfs-utils
# yum Install Rpcbind

Setting up the Boot service
Chkconfig NFS On
Chkconfig Rpcbind on

Start related services
Service Rpcbind Start
Service NFS Start

Query if NFS is installed on the system
[[email protected] ~]$ Rpm-qa|grep NFS
Nfs-utils-1.2.3-54.el6.x86_64
Nfs-utils-lib-1.1.5-6.el6_5.x86_64
Querying system RPC for installation
[Email protected] ~]$ Rpm-qa |grep rpcbind
Rpcbind-0.2.0-11.el6.x86_64

Create a shared directory
Mkdir-p/home/map/ugc-datadashbord/datas

Edit the/etc/exports file to add the following, server shared directory, client IP address, and permissions
Vi/etc/exports
/home/map/ugc-datadashbord/datas 192.168.80.8 (rw,no_root_squash,insecure)

Display shared Status for NFS
[Email protected] map]$ showmount-e 192.168.80.5
Export list for 192.168.80.5:
/home/map/ugc-datadashbord/datas 192.68.80.8

Second, the client configuration:
Install software, set boot start service, start service and server side
To create a mount point
Mkdir-p/maphd2/ugc-datadashbord/datas

Mount Directory
[[email protected] maphd1]$ sudo mount-t NFS 192.168.80.5:/home/map/ugc-datadashbord/datas/maphd2/ugc-datadashbord/ Datas-o Nolock

Viewing the Mounted directory
[[email protected] maphd1]$ DF
Filesystem 1k-blocks used Available use% mounted on
/dev/mapper/volgroup-logvol01
254295652 85901272 155476828 36%/
Tmpfs 8141228 0 8141228 0%/dev/shm
/DEV/SDB1 495844 61855 408389 14%/boot
/DEV/SDA1 2113784984 1262966564 743444380 63%/maphd1
/dev/sda2 1731925332 1569866636 74081940 96%/maphd2
192.168.80.5:/home/map/ugc-datadashbord/datas
255070208 143531008 98582528 60%/maphd2/ugc-datadashbord/datas

Edit/etc/fstab, boot auto mount
Vi/etc/fstab
/maphd2/ugc-datadashbord/datas NFS Rw,tcp,intr 0 1

Linux Server Setup-nfs

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.