糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > nfs文件共享服务器搭建详解

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

时间:2023-09-29 17:43:56

相关推荐

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

服务器端

第一步:安装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文件共享服务器搭建详解》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。