当前位置:网站首页>23nfs shared storage service
23nfs shared storage service
2022-07-27 01:52:00 【Play Jingwu】
NFS Shared storage services
NFS(Network File System) Network file system : Depend on RPC( Remote procedure call ), To be installed nfs-utils、rpcbind software package , system service :nfs、rpcbind, Share profile :/etc/exports, That is, the client realizes sharing across servers
NFS The implementation of a service depends on RPC(Remote Process Cal1, Remote procedure call ) Mechanism , Mapping to the local process . stay Centos7 In the system , Need to install
nfs-utils、rpcbind Software package to provide NFS Shared services , Former used NFS Share publishing and access , The latter is used RPC Support .
Manual loading NFS When sharing services , It should be started first rpcbind, Restart nfs.
nfs Rui slogan 2049
RPC Port number 111
characteristic :
use TCP/IP Transfer network files
Low security
ftp vsftp
Easy to operate
Suitable for LAN environment
The experimental steps :
install nfs and rpcbind Software
Modify the profile settings share
Create shared directory
Opening service
The client verifies that the shared directory is accessible
#NFS End
rpm -q rpcbind nfs-utils
yum install -y nfs-utils rpcbind

mkdir /nfs_data# Create shared directory
vim /etc/exports#NFS The configuration file is /etc/exports, The file content is empty by default ( No sharing ).
/ route 192.168.10.0/24 (rw,sync,no_root_squash)
Common options :
rw Allow reading and writing
ro Represents read-only
sync Write to memory and hard disk synchronously (rsync=rpc+sync Remote synchronization )no_root_squash: incorrect root Carry out power reduction , Represents when the client uses root Identity access is given to local people root jurisdiction ( The default is root_squash), If not, the client cannot edit or write files in it , Because the default is nfsnobody Authority ,
root_squash: Indicates that the client uses root When users access the shared directory , take root Users are mapped to anonymous users
Other common options :
all squash: All access users are mapped to anonymous users or user groups
async: Save the data in the memory buffer first , Write to disk if necessary , Fast but lose data
subtree check( Default ): If output directory is a subdirectory , be fs The server will check the permissions of its parent directory
no subtree check: Even if the output directory is a subdirectory ,fs The server does not check the permissions of its parent directory , This can improve efficiency
systemctl start rpcbind: You have to start rpc service , because nf Want to rpc Registered port
systemctl start nfs
systemctl enable rpcbind
systemctl enable nfs
netstat -anpu | grep rpc
exportfs -v # The verification results
showmount -e localhost # View the client authentication share

cd /nfs_ data/
# Switch to server End
showmount -e localhost # View the client authentication share
mkdir /data# Create the mounted directory
mount -t nfs 192.168.10.17:/nfs_data /data# Mount the shared directory to the web directory
echo “this is a test” >> /data/test.txt # Client home page file
perhaps modify /etc/fstab Achieve permanent mount :
192.168.10.17:/nfs_data /data nfs defaults,_netdev 0 0

mount -a # Refresh
Forcibly unmount :umount -lf /data
stay NFS Port view information
.(img-bRuTTg4a-1655963787154)]
mount -a # Refresh
Forcibly unmount :umount -lf /data
stay NFS Port view information

边栏推荐
- DevEco-Could not resolve com.huawei.ohos:hap:2.4.5.0.错误
- Ubuntu12.10 installing mysql5.5 (II)
- 数组的定义
- 32三剑客sed
- Notes during in-depth learning (to be improved)
- 32 Three Musketeers sed
- 25PXE高效批量网络装机
- 1101: numbers in reverse order (function topic)
- How should CDC be configured for Oracle cluster mode? I can run normally in stand-alone mode, but I can't read the increment in cluster mode
- MySQL存储过程函数
猜你喜欢

Deveco could not resolve com.huawei.ohos:hap:2.4.5.0. error

Shell(8)循环

ONEFLOW source code list: GDB compilation and debugging

SSH and NFS services

System safety and Application

Hands on experiment of network and VPC

Review of wireless sensor networks (Bilingual)

【无标题】

Regular expression gadget series

小项目——开机自连校园网
随机推荐
1101: numbers in reverse order (function topic)
C language foundation Gobang, very easy to understand, detailed explanation, easy to use
[ctf real question] 2018 WANGDING cup web unfinish
LAMP.
iptables
源码编译安装LAMP
Ubuntu12.10安装Mysql5.5(一)
Shell
Web Service (04) -- Introduction and construction of lamp +discuz Forum
Understanding and learning of internal classes
Constructor, copy function and destructor
34iptables firewall
Application of load balancing
作业1-4学习笔记
Ubuntu12.10安装Mysql5.5(三)
33三剑客awk
Expect interaction free
Shell(10)数组和冒泡排序
继承的详细介绍与理解,看了就懂
mysql视图