当前位置:网站首页>NFS shared storage service installation
NFS shared storage service installation
2022-06-26 12:01:00 【huryer】
NFS Shared storage service installation
One .NFS summary
1. summary
NFS It's based on TCP/IP Transport network file system protocol . By using NFS agreement , The client can access the shared resources in the remote server just like accessing the local directory
NAS Storage : NFS The implementation of a service depends on RPC (Remote Process Call, Remote procedure call ) Mechanism , Mapping to the local process .
stay Centos 7 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 port :2049
RPC port :111
2. characteristic
use TCP/IP Transfer network files
Low security
Easy to operate
Suitable for LAN environment
Two .NFS working principle
NFS The server can make PC The NFS The directory shared by the server is mounted to the local file system , And in the local system , The directory of the remote host is like a partition of its own , It's quite convenient to use ;
2.1NFS Workflow
1. First, the server starts RPC service , And open 111 port
2. Server side start NFS service , And to RPC Register port information
3. The client starts RPC(portmap service ), To the server RPC(portmap) Service request server side NFS port
4. Server side RPC(portmap) Service feedback NFS Port information to client .
5. The client obtains the NFS Port to create and service side of NFS Connect and transfer data .
2.2 Mounting principle
When we're in NFS After the server has set up a shared directory , Others have access to NFS Server's NFS The client can mount this directory to a mount point of its own file system , This mount point can be defined by itself .
After the installation, we can see all the data of the server locally .
3、 ... and .NFS Service deployment
3.1 Server side configuration
# 1. Check and install the software
rpm -q rpcbind nfs-utils
yum install -y rpcbind nfs-utils
# 2. Create shared directory
# NFS Configuration file for , The default file content is empty ( No sharing )
vi /etc/exports
# Set up /share/data For shared directory , allow 192.168.10.0 The network segment IP Address host access
/share/data 192.168.10.0/24(rw,sync,no_root_squash)
# Configuration parameters
Common options describe
rw Allow read and write
ro read-only
sync Synchronous write
async Write buffer first , Write to disk if necessary , Fast , But you lose data
subtree_check If you output a subdirectory , be nfs The service will check its parent directory permissions
no_subtree_check If you output a word Directory , Do not check the parent directory , Increase of efficiency
no_root_squash The client to root Login time , Give it local root jurisdiction
oot_squash The client to root Login time , Map it to an anonymous user
all_squash Map all users to anonymous users
# 3. Start the service
# Be sure to turn it on first rpcbind service
systemctl start rpcbind
# If the service has been started , After changing the configuration information, you need to restart the service
systemctl start nfs
# Check out the detailed nfs Information
exportfs -v
# Reread profile
exportfs -r
# Check out the NFS share directory
showmount -e
# Check port monitoring
# netstat -ntlp|grep -E '^Proto|111|2049'
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 4600/rpcbind
tcp6 0 0 :::2049 :::* LISTEN -
tcp6 0 0 :::111 :::* LISTEN 4600/rpcbind
# Add firewall
firewall-cmd --add-service rpc-bind --permanent
firewall-cmd --add-service mountd --permanent
firewall-cmd --add-service nfs --permanent
firewall-cmd --add-service nfs3 --permanent
# If you need to cancel the open service , Carry out orders :
firewall-cmd --remove-service=rpc-bind --permanent
firewall-cmd --remove-service=mountd --permanent
firewall-cmd --remove-service=nfs --permanent
firewall-cmd --remove-service=nfs3 --permanent
# service iptables restart
firewall-cmd --reload
# View the list of open services
firewall-cmd --zone=public --list-service
3.2 Client configuration
1. Check and install the software
# Client installation nfs, Used to verify that the shared directory is available , But there is no need to start the service
rpm -q rpcbind nfs-utils
yum install -y rpcbind nfs-utils
2. Mount the shared directory locally
# see IP Address published NFS share directory
showmount -e +IP
showmount -e 192.168.10.6
# see rpc Registered port information
rpcinfo -p ip
showmount -e 192.168.10.6
# take NFS Server side 192.168.10.6 Under the /share/data Mount to /data Next
mkdir /data
mount -t nfs 192.168.10.6:/share/data /data
# View the mount
df -Th
# Remove mount
umount /data
# Automatically mount on startup
vi /etc/fstab
192.168.10.6:/share/data /data nfs defaults 0 2
3.3 Service Testing
# File test , Files created on the client , On the server side, you can see , Deployment success .
vi 1.txt
# Performance testing
dd if=/dev/zero of=test bs=1M count=1000
边栏推荐
- This paper introduces the simple operation of realizing linear quadratic moving average of time series prediction that may be used in modeling and excel
- Cross platform members get through the two channels of brand Ren Du
- Lintcode 130 · stacking
- Black squares in word
- Lintcode 130 · 堆化
- Omnichannel membership - tmall membership 2: frequently asked questions
- Statistical genetics: Chapter 2, the concept of statistical analysis
- FastRCNN
- 【毕业季·进击的技术er】忆毕业一年有感
- 【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构
猜你喜欢

Redux related usage

介紹一下實現建模中可能用到的時間序列預測之線性二次移動平均,Excel的簡單操作

Ctrip ticket app KMM cross end kV repository mmkv kotlin | open source

量化初级 -- akshare获得股票代码,最简策略

Prospering customs through science and technology, Ronglian and Tianjin Customs jointly build a genomic database and analysis platform

2021 q3-q4 investigation report on the use status of kotlin multiplatform

How to prevent weight loss under Gao Bingfa?

统计遗传学:第二章,统计分析概念

19:第三章:开发通行证服务:2:在程序中,打通阿里云短信服务;(仅仅是打通阿里云短信服务器,不涉及具体的业务开发)

Redis的最佳实践?看完不心动,算我输!!
随机推荐
量化初级 -- akshare获得股票代码,最简策略
Vulnerability scanning and reverse osmosis of Internet anti artifact
Lintcode 130 · stacking
Laravel admin obtains non auto increment ID and submits hidden forms
Laravel admin login add graphic verification code
深度理解STM32的串口實驗(寄存器)【保姆級教程】
Cet article présente la moyenne mobile quadratique linéaire et le fonctionnement simple d'Excel pour réaliser la prédiction des séries chronologiques dans la modélisation.
基于slate构建文档编辑器
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过
Redis的最佳实践?看完不心动,算我输!!
我想知道同花顺是炒股的么?手机开户安全么?
Redis cannot connect to the server through port 6379
APICloud 实现文档下载和预览功能
TCP interview
I'd like to know what preferential activities are available for stock account opening? Is it safe to open an account online?
I want to know whether flush is a stock market? Is it safe to open a mobile account?
介紹一下實現建模中可能用到的時間序列預測之線性二次移動平均,Excel的簡單操作
中国十大证券app排名 开户安全吗
Basic use of express in nodejs