个人之前做的一个测试,有时候会遇到突发情况,这个我们可以用上
主机cbh 主机jiangsu
需求:在jiangsu这台机器上异步自动挂载cbh上的nfs共享目录
[root@cbh /]# yum install nfs*
[root@cbh /]# mkdir common [root@cbh /]# mkdir /common/side [root@cbh /]# echo “haha” >> /common/side/fuck
[root@cbh /]# vim /etc/exports /common 192.168.3.0/24(rw,async)
[root@cbh /]# service rpcbind start [root@cbh /]# service rpcidmapd start Chkconfig rpcbind on Chkconfig rpcidmapd on
[root@cbh /]# service nfs restart Shutting down NFS daemon: [ OK ] Shutting down NFS mountd: [ OK ] Shutting down NFS quotas: [ OK ] Shutting down NFS services: [ OK ] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Chkconfig nfs on
在jiangsu这台机器上进行配置 [root@jiangsu /]# yum install nfs* [root@jiangsu /]# yum install autofs
[root@jiangsu /]# vim /etc/auto.master /net -hosts /mnt /etc/auto.ldap #添加的信息
[root@jiangsu /]# vim /etc/auto.ldap common 192.168.3.135:/common #添加的信息
[root@jiangsu /]# service rpcbind start [root@jiangsu /]# service rpcidmapd start Chkconfig rpcbind on Chkconfig rpcidmapd on
[root@jiangsu /]# service nfs start [root@jiangsu /]# servcice autofs start [root@jiangsu /]# Chkconfig nfs on [root@jiangsu /]# Chkconfig autofs on
[root@jiangsu /]# cd /mnt [root@jiangsu /mnt]# cd common [root@jiangsu /common]# ls Side [root@jiangsu side]# ls fuck
至此成功 |