In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about the installation and configuration of CentOS system nfs, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
NFS is the abbreviation of Network File System, that is, network file system. Network file system is one of the file systems supported by FreeBSD, also known as NFS. NFS allows a system to share directories and files with others on the network. By using NFS, users and programs can access files on remote systems as if they were local. Let's learn how to install and configure nfs in a CentOS system. First, let's introduce some CentOS system commands that will be used.
Start and stop of CentOS system service
Start the service
# / etc/init.d/nfs start
Out of Service
# / etc/init.d/nfs stop
Restart the service
# / etc/init.d/nfs restart
Server-side configuration of CentOS system
1 create a shared directory # mkdir / home/share
2 create or modify / etc/exports configuration file
The content of this file is very simple, and each line consists of a throw path, a list of customer names, and access options immediately following each customer name:
[shared directory] [hostname or IP (parameters, parameters)]
Where parameters are optional, nfs uses the default options when no parameters are specified. The default sharing option is sync,ro,root_squash,no_delay.
In CentOS systems, when the hostname or IP address is empty, it represents sharing to provide services to any client.
When sharing the same directory with multiple clients, but providing different permissions for each client, you can do this:
[shared directory] [hostname 1 or IP1 (parameter 1, parameter 2)] [hostname 2 or IP2 (parameter 3, parameter 4)]
Here are some common parameters for NFS sharing:
Ro read-only access rw read-write access sync all data on request write share async NFS can request secure NFS to send insecure NFS over a secure TCP/IP port below 1024 before writing data, send wdelay over more than 1024 ports if multiple users want to write to the NFS directory Then write as a group (default) no_wdelay if multiple users want to write to the NFS directory, write immediately, and this setting is not required when using async. Hide does not share its subdirectory no_hide shared NFS directory in the NFS shared directory subtree_check if you share a subdirectory such as / usr/bin, force NFS to check the permissions of the parent directory (default) no_subtree_check and the above relative, do not check the parent directory permissions UID and GID mapping anonymous user anonymous of the all_squash shared file, which is suitable for public directories. No_all_squash preserves UID and GID of shared files (default) all requests of root_squash root users are mapped to the same permissions as anonymous users (default) no_root_squash root users have full administrative access to the root directory anonuid=xxx specifies UID anongid=xxx of anonymous users in NFS servers / etc/passwd files specifies GID of anonymous users in NFS servers / etc/passwd files
The configuration file / etc/exports is as follows:
$cat / etc/exports
/ home/share 192.168.102.15 (rw,sync) * (ro)
On the CentOS system, the installation and configuration of nfs is complete, so we can use NFS.
After reading the above, do you have any further understanding of the installation and configuration of nfs on CentOS system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.