大漠驼铃

置身浩瀚的沙漠,方向最为重要,希望此blog能向大漠驼铃一样,给我方向和指引。
Java,Php,Shell,Python,服务器运维,大数据,SEO, 网站开发、运维,云服务技术支持,IM服务供应商, FreeSwitch搭建,技术支持等. 技术讨论QQ群:428622099
随笔 - 238, 文章 - 3, 评论 - 117, 引用 - 0
数据加载中……

CentOS NFS 网络共享磁盘 配置三步曲

参考:https://www.howtoforge.com/nfs-server-and-client-on-centos-7#-nfs-client-end
1.Server Side配置
yum install nfs-utils
安装完成后,进行配置
mkdir /data/share
chmod -R 777 /data/share
设置自启动
systemctl enable nfs-server ipcbind
systemctl start nfs-server ipcbind

配置
vim /etc/exports
添加以下内容

/data/share 192.168.0.101(rw,sync,no_root_squash,no_all_squash)

其中192.168.0.101为要给哪个客户端IP开放


systemctl restart nfs-server

配置防火墙(如何没有添加防火墙就算了)
firewall-cmd --permanent --zone=public --add-service=nfs
firewall-cmd --reload


2.Client Side 配置

安装配置nfs, 在客户机上的安装 
yum install ufs-utils

systemctl enable rpcbind 
systemctl start rpcbind

mkdir /data/share
chmod  -R 777 /data/share

mount -t nfs  192.168.0.100:/data/share /data/share 

设置/etc/fstab, 自启动nfs
192.168.0.100:/data/share  /data/share nfs defaults 0 0 

systemctl restart rpcbind


3.测试
在192.168.1.100 nfs server中
cd /data/share
touch a.txt
cat aaaa> b.txt
进入192.168.1.101 nfs client中
cd /data/share
查看文件列表 ls
因此所有的功能配置完成了,希望对朋友们有帮助。

posted on 2016-10-22 01:50 草原上的骆驼 阅读(3065) 评论(0)  编辑  收藏 所属分类: Linux


只有注册用户登录后才能发表评论。


网站导航: