查看rpcbind、nfs是否安装

 

rpm -qa|grep nfs

rpm -qa|grep rpcbind

 

yum install -y nfs-utils

yum install -y rpcbind

192.168.8.103 和  192.168.8.106 都要安装

修改参数

vi /etc/exports

/tmp/nfs  192.168.8.106(rw,sync)
/tmp/nfs  192.168.8.107(rw,sync)
/tmp/nfs  192.168.8.108(rw,sync)

exportfs -arv  生效参数

重启

service rpcbind stop
service nfs stop

 

service rpcbind start
service nfs start

 

service rpcbind status
service nfs status

192.168.8.106挂载

 mount -t nfs 192.168.8.103:/tmp/nfs  nfs/

 

 

 

df -h即可看到挂载成功。

挂载nfs

 

查看占用命令:fuser -mv /home/data_azkaban

杀死占用命令:fuser -kv /home/data_azkaban

取消挂载命令:umount -a

 

 

 

注意 有的时候挂不上是因为防火墙没有开通端口

默认设置中 nfs 端口是2049,portmapper 的端口是111,mountd 端口是20048,status 和 nlockmgr 是随机端口。

 

firewall-cmd --state

firewall-cmd --permanent --add-port=111/tcp
firewall-cmd --permanent --add-port=111/udp
firewall-cmd --permanent --add-port=2049-2051/tcp
firewall-cmd --permanent --add-port=2049-2051/udp
firewall-cmd --permanent --add-port=20048/tcp
firewall-cmd --permanent --add-port=20048/udp
firewall-cmd --reload

防火墙重启

firewall-cmd --add-service=nfs --permanent
firewall-cmd --reload

 

 

 

 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-08-31
  • 2021-10-20
  • 2021-09-21
  • 2022-01-19
  • 2022-12-23
猜你喜欢
  • 2021-11-12
  • 2022-12-23
  • 2021-12-05
  • 2021-12-24
  • 2022-01-22
  • 2021-05-22
相关资源
相似解决方案