首页 > 其他分享 >Use nfs Storage Service on openEuler

Use nfs Storage Service on openEuler

时间:2022-11-24 17:36:14浏览次数:67  
标签:opt tmp Use rpcbind ## Storage systemctl nfs

一、Use nfs Storage Service on openEuler

nfs 是网络文件系统,用于Linux与Linux之间文件共享的解决方案

nfs 服务安装配置

## 查看是否安装NFS
rpm -qa nfs-utils rpcbind

## 安装 nfs
dnf isntall -y nfs-utils rpcbind

启动服务

## 启动服务
systemctl start rpcbind
systemctl start nfs-server

## 开机启动服务
systemctl enable rpcbind
systemctl enable nfs-server

## 查看服务状态
systemctl status rpcbind
systemctl status nfs-server

## 停止服务
systemctl stop rpcbind
systemctl stop nfs-server

查看端口进程

## 
dnf install -y net-tools lsof
## 查看rpc
lsof -i :111
netstat -lntup |grep rpcbind

## NFS常见进程详解
ps -ef  |egrep "rpc|nfs"

查看 nfs 服务向rpc注册的端口信息

## nfs 服务确认启动成功
rpcinfo -p

 nfs 服务器端配置 nfs共享

mkdir -p /opt/nfs/data

## nfs 共享的目录 nfs客户端地址1(参数1,参数2,...) 客户端地址2(参数1,参数2,...)
cat > /etc/exports << EOF
/opt/nfs/data 10.0.1.0/24(rw)
EOF

## nfs 的配置文件生效
exportfs -rv

查看nfs服务器挂载情况

showmount -e localhost

挂载测试

mkdir /opt/tmp
mount -t nfs 10.0.1.55:/opt/nfs/data /opt/tmp

## 查看挂载
df -h

## 在 /opt/nfs/data 下创建文件
touch /opt/nfs/data{1..10}.txt

## 查看 /opt/tmp 是否有文件
ll /opt/tmp

## 卸载挂载
umount /opt/tmp

 

 

 

 

 

X、One Step Success

 


Y、 Error message

 


Z、Related Links

 

标签:opt,tmp,Use,rpcbind,##,Storage,systemctl,nfs
From: https://www.cnblogs.com/huaxiayuyi/p/16922116.html

相关文章