热门标签 | HotTags
当前位置:  开发笔记 > 程序员 > 正文

Centos6.4NFS的安装与配置

安装:[root@localhostetc]#rpm-qa|grepnfsnfs-utils-lib-1.1.5-6.el6.i686nfs4-acl-tools-0.3.3-6.el6.i686nfs-utils-1.2.3-36.el6.i686[root@localhostetc]#rpm-qa|greprpcbindrpcbind-0.2.0-11.el6.i6

安装:


[root@localhost etc]# rpm -qa | grep nfs
nfs-utils-lib-1.1.5-6.el6.i686
nfs4-acl-tools-0.3.3-6.el6.i686
nfs-utils-1.2.3-36.el6.i686


[root@localhost etc]# rpm -qa | grep rpcbind
rpcbind-0.2.0-11.el6.i686
[root@localhost etc]#


以上两个软件如果没有安装,可以用yum,在线安装。


配置:


主要配置文件:/etc/exports
[root@localhost /]# vi /etc/exports
/tmp 192.168.0.0/24(rw)                                        //把“/tmp”共享给192.168.0.0网段(可读)。
/tmp 192.168.0.65(rw,sync,no_root_squash)    //把“/tmp”共享给192.168.0.65(可读可写,同步)。


[root@localhost etc]# service portmap restart
停止 portmap:[  确定  ]
启动 portmap:[  确定  ]
[root@localhost etc]# service nfs restart    //设置完成后重启服务
关闭 NFS mountd:[  确定  ]
关闭 NFS 守护进程:[  确定  ]
关闭 NFS quotas:[  确定  ]
关闭 NFS 服务: [失败]
启动 NFS 服务: [  确定  ]
关掉 NFS 配额:[  确定  ]
启动 NFS 守护进程:[  确定  ]
启动 NFS mountd:[  确定  ]


[root@localhost etc]# showmount -e    //查看自己共享的服务
Export list for localhost.localdomain:
/tmp 192.168.0.0/24,localhost


[root@localhost tmp]# showmount -a    //显示已经与客户端连接上的目录信息
All mount points on localhost.localdomain:
192.168.0.213:/tmp
================================


客户端连接:

# showmount -e 192.168.0.248    //列出可供使用的NFS
Export list for 192.168.0.248:
/tmp 192.168.0.65,192.168.0.213


# mount 192.168.0.248:/tmp /mnt    //挂载“/tmp”目录到“/mnt”下。


===========================================================================

NFS的挂载错误:

# mount 192.168.0.70:/tmp /mnt/tmp

mount1831-008 放弃:

192.168.0.70/tmp

vmount: 操作不允许执行。

# nfso -p -o nfs_use_reserved_ports=1

正在将 nfs_use_reserved_ports 设置为 1

正在 nextboot 文件中将 nfs_use_reserved_ports 设置为 1

# mount 192.168.0.70:/tmp /mnt/tmp

# ls /mnt/tmp



推荐阅读
author-avatar
柒捌玖指向标
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有