网站制作学习网Linux→正文:linux NFS安装配置
字体:

linux NFS安装配置

Linux 2015/4/14 19:23:55  点击:不统计

%77w%77%2E%66%6F%72%61%73%70%2E%63%6E
 在CentOS6.3安装NFS服务

NFS 首先安装服务端192.168.1.5(共享盘符或者内容的服务器)
yum search nfs-utils  搜索 
yum install nfs-utils.x86_64 安装
yum search rpcbind 搜索NFS插件
yum install rpcbind.x86_64 安装NFS插件 nfs共享时候负责通知客户端,服务器的nfs端口号的
安装完毕后,启动相关服务
service rpcbind start
service nfs start
 
 
启动的时候不用理会下面的错误
NFS mountdc.mountd: svc_tli_create: could not open connection for udp6
rpc.mountd: svc_tli_create: could not open connection for tcp6
rpc.mountd: svc_tli_create: could not open connection for udp6
rpc.mountd: svc_tli_create: could not open connection for tcp6
rpc.mountd: svc_tli_create: could not open connection for udp6
NFS c.nfsd: address family inet6 not supported by protocol TCP
 
加入系统启动
chkconfig --list rpcbind
chkconfig --list nfs
//进行与系统等级相同的启动
chkconfig --level 35 rpcbind on
chkconfig --level 35 nfs on
 
我们假设 将192.168.1.5 下的/data/文件夹共享给192.168.1.6服务器
编辑vim /etc/exports
/data 192.168.1.6(rw,sync,no_root_squash)
上面的意思讲data 分享给192.168.1.6服务器 权限为读写
重启服务
service nfs start
service rpcbind start
 
查看目前本服务器分享的内容 
exportfs
可以看到结果
/data           192.168.1.6
====================上面是服务端,分割线,下面是客户端=======================
我们开始客户端的配置,客户端挂载192.168.1.5的分享磁盘。
命令格式:mount NFS服务器IP:共享目录 本地挂载点目录
我们登录客户端 192.168.1.5 然后执行
mount 192.168.1.6:/data    /data/datatwo
 
然后,我们就可以看到 datatwo里面的内容了
 
解除挂载 umount /data/datatwo即可。
 
 
说明修改exports一定运行,查看挂载情况
exportfs -rv
 
重启nfs命令
service  nfs restart

学习www.网for站asp制.cn作

·上一篇:linux只允许某个IP访问某个(80)端口 >>    ·下一篇:iptables 允许curl 本地 允许本服务器所有请求 >>
推荐文章
最新文章