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 use NFS for shared storage service? Bring everyone to practice.

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

NFS Shared Storage Services

Open two Centos systems: 7-1 (server) and 7-2 (client)

Add a disk, 40 gigabytes, to the 7-1 server and configure it after the restart. Xshell remote connects 7-1 and 7-2 systems. Set the hostnames of 7-1 and 7-2 to server and client, respectively. View newly added disks

Divide it into a partition, 40 gigabytes, and save it; then format sdb1 (xfs file system in centos 7, ext4 in centos6).

Set it to automount, edit it in/etc/fstab, and mount it to the mnt directory

Re-read the configuration data in fstab and view the mount status.

Server-side installation of related packages: remote procedure call package and viewing toolkit

The default setting is boot-up. It can also be operated without setting.

Edit in NFS configuration file/etc/exports, save and exit after editing

Turn on NFS service and rpcbind system service (software service for accessing remote resources), turn off firewall, etc.

View shared directories provided by NFS servers

Go back to 7-2 client, turn off firewall, etc., install httpd service, site of website under/var/www.html file

The first method is to mount the shared directory mnt to the site of the website.

The second method is to set automatic mount or edit it under etc/fstab. After editing, read the data again and check the network status.

Edit an html page in var/www/html, write this is nfs web content, open httpd service, and directly access the browser.

Whether the files are stored locally or on a remote server, go back to server 7-1 and check the mnt directory. Found html web pages, which are typical of web remote storage.

Suppose the server suddenly goes down at this time, and the client operation card dies. What should I do? Stop the nfs service on the server first, so that it can cause downtime

Viewing in client 7-2, it will be directly stuck.

At this time, we open another terminal 7-2 [tty (control quantity) quantity is large]

Unmount by typing the command umount -lf (lowercase letter l and number 1).

Nutrition Express: When we encounter sudden downtime of NFS server, the client will directly appear stuck phenomenon, at this time, we need to reopen a terminal, use umount-lf to force the release of busy file system, friends remember??

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

Servers

Wechat

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

12
Report