Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build NFS under Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to build NFS under Linux. The quality of the article is high, so Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

NFS stands for Network File System. NFS is a network protocol for file sharing between systems that allows users to access files shared on the network as if they were local files.

CentOS comes with NFS functionality

yum install -y nfs-utils rpcbind

This experimental platform: CentOS release 6.8 (Final) Server IP: 172.17.99.67 Customer IP: 172.17.99.61 I. Environment construction 1. Edit the configuration file/etc/exportsvim /etc/exports

/ane/data/LBLOGS 172.17.99.61(rw,sync,no_root_squash)

/ane/data/LPLOGS *(ro,sync)

#indicates that only 172.17.99.61 has read and write permissions LBLOGS, only read permissions LPLOGS

2. modify fixed port vim /etc/sysconfig/nfs

RQUOTAD_PORT=30001

LOCKD_TCPPORT=30002

LOCKD_UDPPORT=30002

MOUNTD_PORT=30003

STATD_PORT=30004

Second, build NFS1. Create nfs shared directory mkdir /ane/data/LBLOGS -p

mkdir /ane/data/LPLOGS -p

2. Start nfs service nfs start

service rpcbind start

3. showmount -e 172.17.99.131

clnt_create: RPC: Program not registered

#This error is caused by the wrong order of starting nfs application

4. restart nfs service nfs stop

service rpcbind stop

#must be started in the following order

service rpcbind start

service nfs start

5. Customer service inquiry showmount -e 172.17.99.67

Export list for 172.17.99.67:

/ane/data/LBLOGS 172.17.99.61(rw,sync,no_root_squash)

/ane/data/LPLOGS *(ro,sync)

6. mount -t www.example.com/ane/data/LBLOGS 172.17.99.67:/ane/data/LBLOGS

mount -t 172.17.99.67:/ane/data/LPLOGS /ane/data/LPLOGS

7. Check mount| grep nfs

172.17.99.67:/ane/data/LBLOGS on /ane/data/LBLOGS type nfs (ro,vers=4,addr=172.17.99.67,clientaddr=172.17.99.61)

172.17.99.67:/ane/data/LPLOGS/ on /ane/data/LPLOGS type nfs (rw,vers=4,addr=172.17.99.67,clientaddr=172.17.99.61)

III. Other nfs configurations 1. The requested URL/data/index.php was not found 172.17.99.131:/ane/data/YTLOGS/

mount.nfs: access denied by server while mounting 172.17.99.131:/ane/data/YTLOGS/

#Because of version issues

mount -o v3 172.17.99.131:/ane/data/YTLOGS/ /ane/data/YTLOGS/ #Specify the version to mount

2. On-demand automount (indirect mapping)#modify timeout for inactivity

vim /etc/sysconfig/autofs

TIMEOUT=300

Amend to

TIMEOUT=600

That is, the inactivity timeout was changed from 5 minutes to 10 minutes.

3. Install vim /etc/fstab

172.17.99.67:/ane/data/LPLOGS /ane/data/LPLOGS nfs defaults 0 0

4. Linux is a free-to-use and freely distributed UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux to run major Unix tools, applications and network protocols.

How to build NFS under Linux is shared here. I hope the above content can help you and learn more. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report