详解AIX 5L NFS Server的建设(1)


对于AIX大家应该有所了解。那么现在我们主要讲解一下NFS服务器的大家,那么我们的平台则是AIX 5L。那么具体的在AIX 5L上配置NFS Server/Client的过程我们就来详细介绍一下。

一、配置AIX 5L NFS Server 

首先需要启动NFS Server,可以通过smit nfs–> Network File System (NFS) –>Configure NFS on This System启动或者停止nfs服务组。

可以通过lssrc -g nfs查看nfs的服务情况

  1. #lssrc -g nfs  
  2.  
  3.     Subsystem         Group            PID          Status  
  4.      biod             nfs              712706       active  
  5.      nfsd             nfs              635260       active  
  6.      rpc.mountd       nfs              462932       active  
  7.      rpc.lockd        nfs              639418       active  
  8.      rpc.statd        nfs              757914       active  
  9.      nfsrgyd          nfs                           inoperative  
  10.      gssd             nfs                           inoperative 

当然,以上也可以通过startsrc -g nfs与stopsrc -g nfs启动与停止该服务组子系统。每当系统启动时,/etc/rc.nfs运行exportfs命令来读取服务器上的/etc/exports文件,然后告诉内核要导出哪些目录与对应的权限。然后rpc.mountd和以上守护进程由/etc/rc.nfs启动。

/etc/exports指定了AIX 5L nfs server要导出的目录与权限,该文件内容如下,如

  1. #more /etc/exports  
  2. /u01/logs -sec=sys:krb5p:krb5i:krb5:dh:none,rw,access=host_name 

注意:这里的access一定要写机器名,其机器名对应的ip在/etc/hosts中体现出来

用exportfs可以导出该目录,如:

  1. #/usr/sbin/exportfs -a  
  2. #/usr/sbin/exportfs  
  3. /u01/logs -sec=sys:krb5p:krb5i:krb5:dh:none,rw,access=host_name 

关于更多的exportfs的用法,可以查看相关帮助,另外,/etc/xtab则与/ext/exports有一样的格式,运行exportfs的时候,/etc/xtab将被更新,这样可以临时导出一个目录而不更新exports文件。

关于/etc/exports的更新,也可以用smit nfs–>Network File System (NFS) –>Add a Directory to Exports List或者是Change / Show Attributes of an Exported Directory来实现,如

  1. #smit chnfsexp  
  2.  
  3.     * Pathname of directory to export                     /u01/logs  
  4.       Anonymous UID                                      [-2]  
  5.       Public filesystem?                                 [no]  
  6.     * Change export now, system restart or both           both  
  7.       Pathname of alternate exports file                 []  
  8.       Allow access by NFS versions                       []  
  9.       External name of directory (NFS V4 access only)    []  
  10.       Referral locations (NFS V4 access only)            []  
  11.       Replica locations                                  []  
  12.       Ensure primary hostname in replica list             yes  
  13.       Allow delegations?                                 []  
  14.       Security method                                    [sys,krb5p,krb5i,krb5,dh,none]  
  15.           Mode to export directory                       [read-write]  
  16.           Hostname list. If exported read-mostly         []  
  17.           Hosts & netgroups allowed client access        [host_name1,host_name2]  
  18.           Hosts allowed root access                      [] 

验证服务器中上的 /etc/exports 文件是否列出客户机要安装的文件系统名称以及该文件系统是否已导出。输入以下命令进行操作:

  1. #showmount -e server_name 

该命令在AIX 5L NFS Server/client上都可以正常运行,列出了由 server_name 当前导出的所有文件系统。


相关内容