当前位置:网站首页>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

边栏推荐
- MySQL主从复制与读写分离
- LAMP.
- Big model training is difficult to go to the sky? Here comes the efficient and easy-to-use "Li Bai" model library
- Typescript 14 starting from 0: built in tool type
- 23NFS共享存储服务
- LAMP.
- 1101: numbers in reverse order (function topic)
- Shell编程规范与变量
- HarmonyOS图像处理应用开发实战直播笔记
- Ubuntu12.10 installing mysql5.5 (II)
猜你喜欢
随机推荐
【无标题】
[cann training camp] enter media data processing (Part 2)
Shell (12) regular expression
Shell
c语言基础五子棋,十分的易懂理解,详细解释,容易上手
Shell(8)循环
CDC only supports PostgreSQL database to version 12? Is there any plan to support version 14? Does anyone know?
The bottom implementation of string container
PXE实验
It's the first time to write your own program in C language. If you have a boss, you can help a little
信息获取技术复习
21DNS域名解析
Process and planned task management
39安装 LNMP
Regular expression gadget series
shell循环语句
CEPH (distributed storage)
ONEFLOW source code list: GDB compilation and debugging
系统安全及应用
Proxmox ve installation and initialization









