免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1767 | 回复: 0
打印 上一主题 下一主题

[安装配置] NFS基本概念及其配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-07 00:47 |只看该作者 |倒序浏览



第一、概念
1、  Nfs依赖的2种协议,包括表示层的XDR和会话层的RPC(呵呵,就是在冲击波风波中出了名的家伙)。
2、  nfs 守候进程和它们的子系统。
序号
进程全路径
子系统名
组名
1
/usr/sbin/portmap
portmap
portmap
2
/usr/sbin/nfsd
nfsd
nfs
3
/usr/sbin/biod
biod
nfs
4
/usr/sbin/rpc.lockd
rpc.lockd
nfs
5
/usr/sbin/rpc.statd
rpc.statd
nfs
6
/usr/sbin/rpc.mountd
rpc.mountd
nfs
3、2和3成对完成预读后写功能。保证系统响应速度。
4、4和5配对,完成文件锁定功能。
5、服务端需要1,2,6进程;客户端需要1,3,4,5进程。
第二、服务器配置
PS:在配置NFS 的第一步是在服务器和客户机两端启动NFS服务。NFS服务由/etc/rc.nfs命令文件来启动的。
1、启动NFS服务 mknfs or smit mknfs
# mknfs -N
0513-029 The portmap Subsystem is already active.
Multiple instances are not supported.
Starting NFS services:
0513-029 The biod Subsystem is already active.
Multiple instances are not supported.
0513-029 The rpc.statd Subsystem is already active.
Multiple instances are not supported.
0513-029 The rpc.lockd Subsystem is already active.
Multiple instances are not supported.
Completed NFS services.
2、关闭NFS服务。rmnfs or smit rmnfs
3、如果没有/etc/exports文件,使用mknfs命令之后,nfsd、rpc.exportd进程不会启动,需要添加一个空的此文件。(试验已经证明)另外如果单独使用startssrc命令来单独启动这2个进程,这个进程可以正常启动,但是可否正常使用。就不可而知了。
4、服务器端配置过程
a.运行mknfs
b.导出nfs目录,smitty mknfsexp
[TOP]                                                   [Entry Fields]
* Pathname of directory to export                    []                       /
  Anonymous UID                                      [-2]
  Public filesystem?                                  no                     +
* Export directory now, system restart or both        both                   +
  Pathname of alternate exports file                 []
  Allow access by NFS versions                       []                      +
  External name of directory (NFS V4 access only)    []
* Security method                                    [sys,krb5p,krb5i,krb5,> +
*     Mode to export directory                        read-write             +
      Hostname list. If exported read-mostly         []
      Hosts & netgroups allowed client access        []
      Hosts allowed root access                      []
  Security method                                    []                      +
      Mode to export directory                       []                      +
[MORE...18]
主要需要指定导出的目录就可以了。而这个工具最终会修改/etc/exports文件。这个文件的内容很简单的。当然是否导出也只是这个文件在控制。
/home/nfs -sec=sys:krb5p:krb5i:krb5:dh:none,rw
/home/kk -sec=sys;krb5p:krb5i:krb5:dh:none,ro
可以看出来这个nfs已经导出2个目录,留意这个所谓导出的目录,需要是本地本地系统存在的目录,意思是这些目录里面的内容可以供客户端读取(写入),否则会出现导出失败的报错。如果手工修改这个文件,执行
# exportfs
/home/nfs -sec=sys:krb5p:krb5i:krb5:dh:none,rw
/home/kk  -sec=sys:krb5p:krb5i:krb5:dh:none,ro
来重新读取这个文件,使之生效即可。
5、客户端配置
[TOP]                                                   [Entry Fields]
* Pathname of mount point                            []                       /
* Pathname of remote directory                       []
* Host where remote directory resides                []
  Mount type name                                    []
* Security method                                    []                      +
* Mount now, add entry to /etc/filesystems or both?   now                    +
* /etc/filesystems entry will mount the directory     no                     +
   on system restart.
* Mode for this NFS file system                       read-write             +
* Attempt mount in foreground or background           background             +
  Number of times to attempt mount                   []                       #
  Buffer size for read                               []                       #
  Buffer size for writes                             []                       #
  NFS timeout. In tenths of a second                 []                       #
  NFS version for this NFS filesystem                 any                    +
  Transport protocol to use                           any                    +
输入安装点,远程安装点,主机名等信息就会在/etc/filesystems中生产这个fs的信息。然后可以直接访问之。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/17046/showart_124374.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP