linux nfs共享存储,nfs服务器共享存储

NFS的使用:

主机   192.168.189.129

备份机 192.168.189.130

9134df61ba55224f85afd9d18513463e.png

实验操作:准备一台服务器当存储服务器,在其上部署nfs(192.168.189.129)

1)机器下载  rpcbind 和 nfs-utils

yum -y install rpcbind nfs-utils

开启服务,并在主服务器设置开机自启

linux 6:

service rpcbind start

service nfs start

chkconfig rpcbind on

chkconfig nfs on

linux 7:

systemctl start rpcbind

systemctl enable rpcbind

systemctl start nfs

systemctl enable nfs

2)准备一个共享目录

mkdir /opt/html

3)编辑共享文件

编辑共享文件

vim /etc/exports

/opt/html 192.168.189.0/24(rw,no_root_squash) #赋予读写权限

重载共享配置文件

exportfs -rv

关闭相关防火墙,selinux

linux 6:

service iptables stop

setenforce 0

linux 7:

systemctl stop firewalld

setenforce 0

4) 在客户端挂载该共享目录(192.168.189.130)

首先下载nfs

yum -y install nfs-utils

下一步:

挂载129机器

showmout -e 192.168.189.129

如果可以看到共享的目录,说明可以执行挂载该目录了

mount -t nfs 192.168.189.129:/opt/html /var/www/html

执行mount命令查看是否挂载成功

mount

成功:192.168.189.129:/opt/html on /var/www/html type nfs (rw,vers=4,addr=192.168.189.129,clientaddr=192.168.189.130)

261d4b403a48f7885ef2aa150ca9c4c0.png

6b76271613952ea58fe0cf2c721f9dcc.png

标签:rpcbind,192.168,189.129,html,nfs,服务器,共享

来源: https://www.cnblogs.com/security-guard/p/12076046.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值