当前位置:网站首页>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
边栏推荐
- 动态规划解决股票问题(下)
- TCP interview
- [graduation season · advanced technology Er] I remember the year after graduation
- 修改calico网络模式为host-gw
- Solidworks渲染技巧如何不显示边线--显示样式设定
- How do consumer goods enterprises formulate membership interests?
- FasterRCNN
- In depth understanding of STM32 serial port experiment (register) [nanny level tutorial]
- Hello! Forward proxy!
- Refined operation, extending the full life cycle value LTV
猜你喜欢

统计遗传学:第一章,基因组基础概念

Pratique de l'attaque et de la défense du réseau HUST | 6 Expérience de sécurité du microprogramme de l'équipement IOT | expérience 2 technologie d'atténuation des attaques de l'équipement IOT basée s

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

SolidWorks rendering tips how not to display edges -- display style settings

HUST網絡攻防實踐|6_物聯網設備固件安全實驗|實驗二 基於 MPU 的物聯網設備攻擊緩解技術

FastRCNN

. Net, the usage of log components NLog, seriallog, log4net

How to prevent weight loss under Gao Bingfa?

【概率论】条件概率、贝叶斯公式、相关系数、中心极限定理、参数估计、假设检验

Omnichannel membership - tmall membership 1: opening tutorial
随机推荐
哈希表的前置知识---二叉搜索树
18: Chapter 3: development of pass service: 1: SMS login & registration process, introduction; (SMS verification code is used here)
介绍一下实现建模中可能用到的时间序列预测之线性二次移动平均,Excel的简单操作
NFS共享存储服务安装
This paper introduces the simple operation of realizing linear quadratic moving average of time series prediction that may be used in modeling and excel
HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 2 MPU based IOT device attack mitigation technology
Jmeter响应时间和tps监听器使用教程
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.
On the use of protostaff [easy to understand]
Loggie encoding and newline character test
再获认可!知道创宇入选“业务安全推进计划”首批成员单位
深度学习中的FLOPs和Params如何计算
基于slate构建文档编辑器
Five trends of member management in 2022
TCP面试
科技兴关,荣联与天津海关共建基因组数据库及分析平台
HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过
VMware virtual machine bridging mode can not access the campus network "suggestions collection"
Build document editor based on slate
Vulnerability scanning and reverse osmosis of Internet anti artifact