nfs部署

------------------------服务端--------------------
环境
OS:Centos 7
服务端IP:192.168.56.142
客户端IP:192.168.56.141

142的目录/archlog 挂载到141的目录/archlog2下

1.安装nfs
yum -y install nfs-utils

2.编辑exports文件
vim /etc/exports
写入
/archlog 192.168.1.141(rw,sync,all_squash,anonuid=1001,anongid=6000)

或是配置如下
/archlog 192.168.1.141(rw,sync,all_squash,anonuid=0,anongid=0)

格式是:
要共享的目录 对方的IP及掩码或者域名(权限,同步更新)
这里的anonuid和anongid分别是141服务器上oracle用户的id和组
可以通过id oracle查看
[oracle@host01 archlog2]$ id oracle
uid=1001(oracle) gid=6000(oinstall) groups=6000(oinstall),5001(asmdba),6001(dba)


3.先为rpcbind和nfs做开机启动:(必须先启动rpcbind服务)
systemctl enable rpcbind.service
systemctl enable nfs-server.service
然后分别启动rpcbind和nfs服务:
 
systemctl restart rpcbind.service
systemctl restart nfs-server.service

systemctl stop rpcbind.service
systemctl stop nfs-server.service

systemctl status rpcbind.service
systemctl status nfs-server.service

4.查看挂载输出的目录
[root@host02 /]# exportfs -rv
exporting 192.168.56.141:/archlog


--------------客户端-----------------------------------------
1.安装nfs
yum -y install nfs-utils

2.创建挂载的目录
mkdir -p /archlog2
chown -R oracle:oinstall /archlog2
我这里也创建一个跟服务器一致的目录,实际情况可以不需要一致.

3.手工mount
mount -t nfs 192.168.56.142:/archlog /archlog2


4.umount
切换到其他目录执行如下命令,在当前目录执行会包系统资源忙的错误.
umount -f /archlog2

posted @   slnngk  阅读(282)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示