打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
centos6.2下配置nfs
转自:http://blog.sina.com.cn/s/blog_98a0937f0100yc35.html
centos6.2变更了portmap服务为rpcbind,在使用nfs时这点与centos5不同,下面配置一个nfs系统,用来使局域网内的所有用户均可访问该目录,可将该目录配置成yum源,供内网机器安装软件。

首先安装NFS套件,命令如下:

yum install nfs-utils.x86_6464位系统

然后安装portmap服务,portmapcentos6中改名为rpcbind

yum install rpcbind(centos6)

yum install portmap(centos5)

 配置nfs服务端

vi /etc/exports

添加

/opt/centos6 192.168.0.0/24(ro,no_root_squash)

这一行表明本机的/opt/centos6这个目录为nfs共享目录,可访问的ip地址区间为192.168.0.0-192.168.0.254,权限为只读,当访问者为root用户时方位该目录具有root权限

 重启nfs服务

/etc/init.d/rpcbind start

/etc/init.d/nfs start

/etc/init.d/nfslock start

 客户端配置

查看是否能访问nfs服务

showmount -e 192.168.0.10

显示如下:

 Export list for192.168.0.10:

/opt/centos6 192.168.0.11

 表示可以访问,如不可访问查看nfs服务端nfs服务是否启用,防火墙是否允许通过。

 挂载nfs目录

mount -t nfs 192.168.0.10:/opt/centos6/ /opt/centos6/


常见错误:
1、mount.nfs: access denied by server while mounting
/如果端口号大于1024,则需要将 insecure选项加入到配置文件(/etc/exports)相关选项中mount客户端才能正常工作:

查看exports 手册中关于secure 选项说明也发现确实如此

[root@lzgonline init.d]# manexports

secure,This  option requires thatrequests originate on an Internet port less than IPPORT_RESERVED(1024). This option is on by default. To turn it off, specifyinsecure.

//secure 选项要求mount客户端请求源端口小于1024然而在使用NAT 网络地址转换时端口一般总是大于1024),默认情况下是开启这个选项的,如果要禁止这个选项,则使用insecure 标识

修改配置文件/etc/exports,加入 insecure选项

/home/lzgonline/rootfs *(insecure,rw,async,no_root_squash

2、mount: wrong fs type, bad option, bad superblock
#yum install nfs-utils-lib-devel
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
NFS服务详细分析
NFS服务器
nfs 错误解决
解决客户端挂载mount网络文件系统nfs共享资源路径报''mount.nfs: Connection...
CentOS 6.3下安裝配置NFS4服務
mount.nfs: access denied by server while mounting 一个解决办法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服