首页 > 其他 > 详细

centos7搭建nfs

时间:2017-01-06 17:19:53      阅读:170      评论:0      收藏:0      [点我收藏+]

#服务端

centos7.2 

#

yum install nfs-utils  rpcbind -y

chmod -R 777 /u02/liyangjie

#start the server

systemctl enable rpcbind

systemctl enable nfs-server

systemctl enable nfs-lock

systemctl enable nfs-idmap

systemctl start rpcbind

systemctl start nfs-server

systemctl start nfs-lock

systemctl start nfs-idmap

vim /etc/exports

#添加如下内容,允许10.0.0.161 10.0.0.196 10.0.0.168 这几个ip访问


/u02/liyangjie 10.0.0.161 10.0.0.196 10.0.0.168(rw,sync,no_root_squash,no_subtree_check)

#

systemctl restart nfs-server

firewall-cmd --permanent --zone=public --add-service=nfs

firewall-cmd --reload



#客户端NFS client end

yum install nfs-utils

#Now create the NFS directory mount point as follows:

mkdir -p /mnt/nfs/home

mkdir -p /mnt/nfs/var/nfsshare

#Start the services and add them to boot menu.

systemctl enable rpcbind

systemctl enable nfs-server

systemctl enable nfs-lock

systemctl enable nfs-idmap

systemctl start rpcbind

systemctl start nfs-server

systemctl start nfs-lock

systemctl start nfs-idmap

Next we will mount the NFS shared content in the client machine as shown below:

mount -t nfs 10.0.0.10:/u02/liyangjie /mnt/nfs/home/



#设置开机挂载

# Permanent NFS mounting

We need to mount the NFS share at client end permanent that it must be mounted even after reboot. So we need to add the NFS-share in /etc/fstab file of client machine as follows:

nano /etc/fstab

Add the entries like this:

[...]

10.0.0.10:/u02/liyangjie    /mnt/nfs/home   nfs defaults 0 0 



注释:查看了外国的一篇文章,简单搭建了nfs服务


本文出自 “禅剑一如” 博客,请务必保留此出处http://yanconggod.blog.51cto.com/1351649/1889740

centos7搭建nfs

原文:http://yanconggod.blog.51cto.com/1351649/1889740

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!