Chinaunix首页 | 论坛 | 博客
  • 博客访问: 357392
  • 博文数量: 93
  • 博客积分: 3010
  • 博客等级: 中校
  • 技术积分: 879
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-06 23:29
文章分类

全部博文(93)

文章存档

2014年(2)

2011年(1)

2010年(2)

2009年(6)

2008年(6)

2007年(13)

2006年(63)

我的朋友

分类:

2006-06-07 00:47:41

 

 

第一、概念

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

323成对完成预读后写功能。保证系统响应速度。

445配对,完成文件锁定功能。

5、服务端需要126进程;客户端需要1345进程。

第二、服务器配置

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命令之后,nfsdrpc.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的信息。然后可以直接访问之。

阅读(847) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~