新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 操作系统 > Unix系统 > HP-Unix教程 > 正文:HP-UX环境下如何配置NFS

HP-UX环境下如何配置NFS

新客网 XKER.COM 2008-03-31 来源: 收藏本文
一般按照如下步骤来配置NFS:
      1. Meet pre-NFS configuration requirements on Client and Server
      2. Meet NFS software requirements on Client and Server
      3. Start Server daemons
      4. Start Client daemons
      5. Configure NFS on Server
      6. Configure NFS on Client
      7. Verify Server configuration
      8. Verify Client configuration
 
   下面,就详细讲解以上步骤的具体配置方法。

   1. Meet pre-NFS configuration requirements on Client and Server
      (1)网卡的状态用ioscan -fnC lan查到的为CLAIMED
      (2)hostname的配置
      (3)IP地址和子网掩码的配置
      (4)route的配置
      (5)/etc/hosts文件的配置,将IP地址和hostname对应起来

   2. Meet NFS software requirements on Client and Server
      (1)NFS fileset loaded?
         用swlist -l product | grep -i nfs命令来查看相关的NFS软件是否安装了,如果没有安装,则使用swinstall命令安装相应的软件。
      (2)Drivers/subsystems in kernel?
         可以使用“sam”来进行确认。

   3. Start Server daemons
      与NFS server有关的后台进程有如下几个:
         (1)portmap
            Dynamic port assignment daemon used by NFS
         (2)nfsd
            NFS server data daemons that are usually started 4 at a time
         (3)mountd
            NFS server that responds to client mount requests
      可以按照如下步骤来启动nfsd和mountd进程:
         (1)配置/etc/rc.config.d/nfsconf,配置以下几个信息:
            NFS_SERVER=1 #(start nfsd)
            NUM_NFSD=4  #(start four of them)
            MOUNTD_OPTIONS="" #(no mountd options shown here)
            START_MOUNTD=1 #(start mountd)
         (2)配置完以上信息以后,重新启动将激活以上的修改配置
      说明:每次系统启动的时候,portmap会被/sbin/rc2.d/S400nfs.core自动启动。

   4. Start Client daemons
      与NFS client有关的后台进程有如下几个:
         (1)portmap
            Dynamic port assignment daemon, used by NFS
         (2)bion
            NFS client data daemons that are usually started 4 at a time
         (3)automount
            Optional NFS client. Dynamic mounting/unmounting daemon
      可以按照如下方法来启动biod和automount进程:
         (1)编辑/etc/rc.config.d/nfsconf, 配置以下几个信息:
            NFS_CLIENT=1   #(start biod)
            NUM_NFSIOD=4   #(start four of them)
            AUTOMOUNT=1    #(start automount)
            AUTO_MASTER="/etc/auto_master" #(automount configuration file)
            AUTO_OPTIONS="-f $AUTO_MASTER" #(use the file above)
         (2)重新启动系统以后,以上配置将会生效

   5. Configure NFS on Server
      (1)确认第三步的配置已经修改完成,而且相应的后台进程已经启动
      (2)确认要exported to clients的文件系统
      (3)确认exported to clients的文件系统有权限被client access
      (4)Optional: Determine if there is any logical grouping of clients that could make use of a "netgroup" name. Referring to this "netgroup" name in configuration files would automatically include all clients defined as a part of the "netgroup".
         看看如下例子:
         #vi /etc/netgroup
         examplegroup1 (host_a,,) (host_b,,) (host_x,,)
         In this example, referring to the "netgroup" name examplegroup1 in a configuration file automatically means host_a, host_b, and host_x.
      (5)Using the decisions made in steps 2 & 3 above, create the export configuration, for example:
         #vi /etc/exports
         /opt/app1
         /usr/share host_c host_d examplegroup1
         In this example, we are exporting 2 file systems: /opt/app1 and /usr/share. Since there no hostname after /opt/app1, we are exporting them to everyone (any system can mount or import them). Since we have names following /usr/share, we are restricting the systems who can mount or import /usr/share to host_c, host_d and all clients who are a part of "netgroup"(examplegroup1 (host_a, host_b, and host_x)).
      (6)If the NFS server daemons weren't running in step 1, reboot the system. If they are already running, type:
         #exportfs -a
      NOTE: Any time you modify /etc/exports after this step, use the -u option with exportfs to unexport the filesystem(s) whose entry was modified and then repeat this step.

   6. Configure NFS on Client
      (1)确认第四步的配置已经修改完成,而且相应的后台进程已经启动,可以用ps -ef命令来查看portmap, nfsd, mountd进程
      (2)用如下命令来确认server的配置:
         #exportfs
         #showmount -e host_a (在这里,host_a是server的hostname)
         #more /etc/netgroup

   7. Verify Client configuration
      (1)Verify that NFS client daemons are running by typing "ps -ef" and looking for the following processes:
         a. portmap
         b. biod (Multiple occurences running)
         c. automount (optional on-demand mounts only)
      (2)See what is currently mounted by typing "mount"
      (3)See what is supposed to be mountd by looking at:
         a. /etc/fstab
         b. /etc/auto_master (optional on-demand mounts only)
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。