查看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

 

 

 

 

 

 

 

 

相关文章: