首页 > 其他 > 详细

nfs文件共享服务器搭建详解

时间:2018-03-27 01:40:44      阅读:285      评论:0      收藏:0      [点我收藏+]
服务器端
第一步:安装nfs-utils
yum -y install nfs-utils
第二步:创建一个共享目录
mkdir /webData
touch /webData/index.html
第三步:写配置文件(/etc/exports)
要写的内容及格式: 共享目录名 + 可以让那些主机共享
vim /etc/exports /webData 192.168.12.0/24(rw)
查看是否搭建成功
exportfs -v
第四步:关闭selinux和firewalld;启动nfs-serves
vim /etc/selinux/config/ 找到SELINUX=改为 SELINUX=disabled
systemctl stop firewalld ; systemctl enable firewalld
systemctl start nfs-server ; systemctl enable nfs-server
客户端
第一步:安装nfs-utils httpd/nginx
yum -y install nfs-utils httpd
第二步:自动挂载共享目录
自动挂载配置文件要写的内容及格式
nfs服务端的共享目录 要挂载到哪里 文件系统是啥类型 default 0 0
查看uuid的命令:blkid
vim /etc/fstab
192.168.12.66:/webData /var/www/html/ nfs default 0 0
生效挂载
mount -a
查看挂载
df -h
第三步:启动nfs服务HTTP服务;关闭防火墙
systemctl start nfs-server ; systemctl restart httpd ; systecmctl stop firewalld ; systemctl enable firewalld
查看服务状态
systemctl status nfs-server

nfs文件共享服务器搭建详解

原文:http://blog.51cto.com/13575678/2091376

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