(失败)
主库ip:192.168.191.5
从库ip:192.168.191.6
1.yum install nfs-utils rpcbind
2.vim /etc/exports /data1/activemq/ 192.168.191.6(rw,sync) ===(/data1/activemq/:192.168.220.103(rw,sync,no_root_squash,no_all_squash))
3. 启动rpcbind服务
service rpcbind restart
4. 启动nfs服务
service nfs restart
5.把这两个服务设置自启动
chkconfig --level 35 nfs on
chkconfig --level 35 rpcbind on
6.在从库192.168.191.6 上挂载共享目录:
mount -t nfs 192.168.191.5:/data1/activemq /data1/activemq ============(mount -t nfs192.168.220.69: /data1/activemq /data1/activemq)
7.设置从库重启系统时自动挂载:
vim /etc/rc.d/rc.local
加入:mount -t nfs 192.168.191.5: /data1/activemq /data1/activemq
wq保存退出
=========================df -Th 产看挂载情况
8.注意关闭防火墙
service iptables stop
(成功)《《=======CentOS 6.8下NFS安装配============》》
=======================================================
服务端
1.yum -y install nfs-utils rpcbind
2.mkdir /usr/local/test
3.vi /etc/exports
#增加一行:
/usr/local/test/ 192.168.191.6(rw,no_root_squash,no_all_squash,sync)
4.exportfs -r
5.service rpcbind restart
6.service nfs restart
客户端
1.mkdir /usr/local/test
2.注意关闭防火墙
service iptables stop
3、测试挂载:
showmount -e 192.168.191.5
4.mount -t nfs 192.168.191.5:/usr/local/test /usr/local/test
5.mount
6.测试:
客户端生成一个文件:
[root@centos2 /]# cd /usr/local/test/
[root@centos2 test]# echo "hello nfs test">>test
[root@centos2 test]# ll
7.服务端检查:
[root@centos2 /]# cd /usr/local/test/
[root@centos2 test]# ll
8.=========================df -Th 产看挂载情况