LINUX NFS配置

主机:10.88.34.59  备机:10.88.34.58
1、现在主机上编写 vi /etc/exports文件
/opt/cmstemp 10.88.34.58(rw,sync,no_root_squash)  #需要将本机的哪个目录共享给哪台服务器
/opt/ftp 10.88.34.58(rw,sync,no_root_squash)
/opt/idealFileData 10.88.34.58(rw,sync,no_root_squash)
2、主机 /etc/init.d/nfs restart
3、NFS加到自动启动项  chkconfig --add nfs
4、主机查看 showmount -e localhost
5、备机mount 主机目录  mount -t nfs 10.88.34.59:/opt/ftp /opt/ftp
6、编写vim /etc/fstab 在备机重启时,自动挂载
10.88.34.59:/opt/cmstemp /opt/cmstemp nfs defaults 0 0
10.88.34.59:/opt/ftp /opt/ftp nfs defaults 0 0
10.88.34.59:/opt/idealFileData /opt/idealFileData nfs defaults 0 0
 
卸载 备机:umount /opt/ftp
重启机器,建议先重启备机在重启主机

猜你喜欢

转载自himo-zhang.iteye.com/blog/2230295