Construction and configuration of NFS server under Linux

Source: Internet
Author: User

Introduction to Services for NFS
NFS is the abbreviation for Network FileSystem, which was first developed by Sun, the company. Its biggest function is to be able to use the network, so that different machines, different operating systems, can share the individual files
Installing NFS Services
To see if the System has NFS installed
[Email protected] ~]# Rpm-qa | grep NFS
[Email protected] ~]# Rpm-qa | grep rpcbind

Installing NFS
[Email protected] ~]# yum-y install nfs-utils rpcbind

server-side configuration
Create a shared directory/data/lys on the NFS server and set permissions
[Email protected] ~]# mkdir-p/data/lys
[Email protected] ~]# ll/data/
[Email protected] ~]# chmod 666/data/lys/

Edit Export File
[Email protected] ~]# Vim/etc/exports

/data/lys client IP (rw,no_root_squash,no_all_squash,sync)

Configuration takes effect
[Email protected] lys]# Exportfs-r
start Rpcbind, NFS services
[[Email protected] lys]# service Rpcbind start
[[Email protected] lys]# Service NFS Start

to view the registration status of the RPC service
[Email protected] lys]# rpcinfo-p localhost

after your NFS server is set up, we can test the server to see if we can go online. is to use the Showmount command to check
[Email protected] lys]# showmount-e localhost
Client Configuration
Installing the Nfs-utils Client
[Email protected] ~]# yum-y install Nfs-utils

Create mount Directory
[Email protected] ~]# Mkdir/lys
View shared directory information thrown by the server
[[email protected] ~]# SHOWMOUNT-E server IP
to improve the stability of NFS, use TCP protocol mount, NFS default UDP protocol
[[email protected] ~]# mount-t NFS 192.168.2.203:/data/lys/lys-o proto=tcp-o nolock

Viewing Mount results
[Email protected] ~]# df-h

View Validation Results
Service Side
[Email protected] lys]# echo "Test" > Test.txt
Client
[Email protected] ~]# Cat/lys/test.txt
Test
[Email protected] ~]# echo "204" >>/lys/test.txt
Service Side
[Email protected] lys]# Cat/data/lys/test.txt
Test
204

Construction and configuration of NFS server 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.