smile_elims

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

服务器1:192.168.1.1
服务器2:192.168.1.2  

192.168.1.1

ssh root@192.168.1.1   password  123456  

关闭防火墙

service iptables stop

 

$yum -y install nfs
$vi /etc/exports
--编辑 此内网网段对/home/share均可读写
/home/share 192.168.1.*/24(rw,sync) -- rw代表 读写   可以用 *(rw,sync)代表任何客户端都可以访问
----保存
$chmod -R 775 /home   --权限
$service rpcbind start  --不知道干啥的
$service nfs start  --开启nfs服务
$chkconfig nfs on  --不知道干啥的
$chkconfig rpcbind on --不知道干啥的

 

192.168.1.2

$yum -y install nfs

$service rpcbind start  --不知道干啥的

$service nfs start  --开启nfs服务
$chkconfig nfs on  --不知道干啥的
$chkconfig rpcbind on --不知道干啥的

 

$mkdir /home/share

$mount 0t nfs 192.168.1.1:/home/share /home/share   --ip一定要是上边开启服务的   :不能缺少  前边的/home/share  是exports里配置的路径   后边的/home/share 是当前的自己新建的文件夹。挂载成功之后,.1服务器上操作了文件夹,.2上就会出现操作的内容了。

$df -h

 

posted on 2019-05-08 14:34  smile_elims  阅读(218)  评论(0编辑  收藏  举报