昨天完成了轨道交通清分中心系统的初步功能测试,其实就是一堆啥也不懂的人在求稍微懂点的人忽悠,不好意思,我作为稍微懂点的人。但是却对啥也不懂的人点头哈腰,低声下气,狗屁需求也要认真考虑,认真分析。ONLY,他们是业主,ONLY,他们欠我们钱。

      期间在闲暇时,于HPUNIX上试试了NFS的搭建,使用SAM工具,感觉非常方便,记录于下:

/*以root执行SAM命令*/
acccsf#[/home/nfs]sam
System Administration Manager (SAM) is deprecated in this release of HP-UX.
System Management Homepage (SMH) is the new tool introduced to manage HP-UX.
You are recommended to use /usr/sbin/smh.

DISPLAY variable is not set. Starting the Text User Interface. Please wait...

/*进入SAM工具菜单*/

                                       HP-UX System Management Homepage (Text User Interface)
                                                                SMH
----------------------------------------------------------------------------------------------------------------------- a - Auditing and Security
 c - Auditing and Security Attributes Configuration(new)
 d - Peripheral Devices
 e - Resource  Management
 f - Disks and File Systems
 g - Display
 k - Kernel Configuration
 l - Printers and Plotters(new)
 m - Event Monitoring Service
 n - Networking and Communications
 o - View samlOg
 p - Printers and Plotters
 s - Software Management
 u - Accounts for Users and Groups

-----------------------------------------------------------------------------------------------------------------------x-Exit smh                     w-WebLaunch        1-Help
ENTER-Launch Functional Area   v-SAM Log Viewer

 

/*选择 n - Networking and Communications */

 

                                                SMH-> Networking and Communications
-----------------------------------------------------------------------------------------------------------------------  s - Network Services Configuration
  i - Network Interfaces Configuration

-----------------------------------------------------------------------------------------------------------------------x-Exit smh   ENTER-Select   Esc-Exit Networking and Communications  

 

/*选择 s - Network Services Configuration */

 

                                SMH-> Networking and Communications-> Network Services Configuration
-----------------------------------------------------------------------------------------------------------------------  b  -  Bootable Devices         ->
  v  -  DHCPv6                   ->
  d  -  DNS (BIND)               ->
  h  -  Hosts                    ->
  n  -  NIS
  s  -  Name Service Switch
  k  -  Network Services
  f  -  Networked File Systems   ->
  r  -  Routes
  c  -  System Access            ->
  t  -  Time                     ->
-----------------------------------------------------------------------------------------------------------------------x-Exit smh   ENTER-Select   Esc-Exit Network Services Configuration 

 

/*选择 f  -  Networked File Systems   -> */

 

                    SMH-> Networking and Communications-> Network Services Configuration-> Networked File Systems
-----------------------------------------------------------------------------------------------------------------------   s - Share/Unshare File System
   a - Automounted Remote File Systems
   n - Netgroups   ->
------------------------------------------------------------------------------------------------------------------------------------
x-Exit smh      ESC-Go Up
ENTER-Details   /-Search  

 

/*选择 s - Share/Unshare File System 当前列出了NFS服务器所共享出来的目录,以及其共享属性 */

 

                      SMH-> Networking and Communications-> Networked File Systems-> Share/Unshare Filesystem

NFS Server Enabled
-----------------------------------------------------------------------------------------------------------------------

Local Directory          Currently Shared    Permanently Shared  Logging Enabled
-----------------------------------------------------------------------------------------------------------------------

/home/nfs                Yes                 No                  No

-----------------------------------------------------------------------------------------------------------------------

x-Exit smh              Enter-Show Details          Esc-Back               c-Configure Log Tag
s-Share a File System   u-Unshare the File System   d-Disable NFS Server   h-Help  

 

/*按照操作提示,可以进行查看当前共享目录详细,配置日志标记,添加共享文件系统,取消共享文件系统,关闭NFS服务器操作。*/
/*选择 s-Share a File System */
/*填写共享目录详细*/

 

     SMH-> Networking and Communications-> Networked File Systems-> Share/Unshare Filesystem-> Add/Modify
-----------------------------------------------------------------------------------------------------------------------File System Type         :  nfs
Local Directory Name*    :  ___________________/*Absolute Path of directory to be shared  */
Resource Name            :  ___________________/*Name by which remote systems can identify and access the shared resource.  */
Description              :  _____________________________/*A short description of the shared resource.  */

For unknown User ID      :   (X)  Use UID of user 'nobody'(default)
                             ( )  Disable Unknown UID Access
                             ( )  Specify UID for Unknown User

Enable Server Logging    :   (X)  No (default)
                             ( )  Yes

Specify Access Options   :   ( )  Secure Access
                             (X)  Standard Access
[ Configure ...  ]/*Configure Access options for sharing the filesystem  */

  [ ]  Allow Asynchronous writes
  [ ]  Ignore enabling the setuid/setgid mode bits(nosuid)
  [ ]  Prevent mounting subdirectories(nosub)
  [ ]  Move the Location of public file handle(public)
  Index Filename         :  ___________________


Share type               :   (X)  Current
                             ( )  Permanent
                             ( )  Both Current and Permanent


[ OK ] [ Cancel ] [ Preview ] [ Help ]

-----------------------------------------------------------------------------------------------------------------------

/*以下是官方流程*/

 

                                                   Share Add/Modify Screen Help
-----------------------------------------------------------------------------------------------------------------------Sharing a file system
=====================
  
   --------------------------------------------
   Note: It is mandatory to provide information
         for the fields marked with "*".
   --------------------------------------------
  
   --------------------------------------------
   Note: By default the File System Type is nfs.
         At present, the tool supports only NFS.
   --------------------------------------------

To share a file system:

1. Enter a valid local directory name in the Local Directory Name field.

2. Enter a resource name in the Resource Name field.
  
   Resource name is the name by which remote systems can identify and
   access the shared resource.

3. Enter a description for the shared file system in the Description field.

4. Select one of the following options to specify the ID for an unknown user:
  
   - Use UID of User 'nobody' (default)
   - Disable Unknown UID Access
   - Specify UID for Unknown User. If you select this option, enter a valid
     user ID in the User ID field.

5. Specify whether you want to enable server logging. Select Yes to
   enable server logging.
  
   If you enable server logging, you must specify a log tag.
  
   To specify the log tag:
  
   a. Select [Specify/Configure Tag] (visible only when you
         select Yes) and press Enter.
      The available tags are displayed in the Existing Tag window.
  
   b. Select a log tag and press s.

      -------------------------------------------------------------------
      Note: You can create a new tag or even modify an existing tag. For
            more information about selecting a tag, creating a new tag, 
            and modifying a tag, see the help in the respective windows.
      -------------------------------------------------------------------

6. Select one of the following options under Specify Access Options:
  
   - Secure Access 
   - Standard Access
  
   If you select Secure Access, you must specify the security mode and
   the access privileges to the clients.
        
         To specify the security mode:
        
         a. Select Configure and press Enter.
            The Secure Access window is displayed.
           
            For more information on how to configure secure access, see the
            help in the Secure Access configuration window.

7. Select one or more of the following options:
   
    - Allow Asynshronous writes
    - Ignore enabling the setuid/setgid mode bits(nosuid)
    - Prevent mounting subdirectories(nosub)
    - Move the Location of public file handle(public)

8. Enter the index filename, if required, in the Index Filename field.
  
   Index file refers to the file (rather than a listing of the directory
   containing this file) that is loaded when the directory is
   referenced by an NFS URL.

9. Specify how you want to share the file system. You can select Current,
   Permanent, or Both Current and Permanent.
  
   Select Current if you want to share the file system temporarily.  
   In this case, the file is shared immediately. However the share is
   removed when one of the following events take place: the system is
   stopped and restarted and NFS server is enabled/disabled.
  
   Select Permanent to share the file system permanently. In this case,
   the file system is shared only after the system is stopped and restarted.
   When you share a file system permanently, it automatically remains
   shared even after one or both of the following events take place: the
   system is stopped and restarted and NFS server is enabled/disabled. 
   The share information is updated in the /etc/dfs/dfstab file.
  
   Select Both Current and Permanent to share the file system immediately
   and permanently.
  
10. Select [OK] and press Enter to share the file system. The file system
    is shared and displayed in the Share/Unshare Filesystem main window. 

-----------------------------------------------------------------------------------------------------------------------x-Exit smh   /-Search
Esc-Back

/*共享完成后,检查NFS服务进程,保证nfs与mountd服务正常。*/
acccsf#[/etc/rc.config.d]rpcinfo -p | grep nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
acccsf#[/etc/rc.config.d]rpcinfo -p | grep mountd
    100005    1   udp  49523  mountd
    100005    1   tcp  49212  mountd
    100005    2   udp  49523  mountd
    100005    2   tcp  49212  mountd
    100005    3   udp  49523  mountd
    100005    3   tcp  49212  mountd

/*启动或关闭NFS服务命令*/
acccsf#[/sbin/init.d]./nfs.server start
acccsf#[/sbin/init.d]./nfs.server stop

/*NFS日志配置文件*/
acccsf#[/etc/nfs]vi nfslog.conf

/*NFS服务配置文件*/
acccsf#[/etc/rc.config.d]vi nfsconf

/*使用nfsstat命令监视NFS的活动状况*/
acccsf#[/etc]nfsstat -s

Server rpc:
Connection oriented:
calls                   badcalls                nullrecv               
83                      0                       0                      
badlen                  xdrcall                 dupchecks              
0                       0                       27                     
dupreqs                
0                      
Connectionless oriented:
calls                   badcalls                nullrecv               
0                       0                       0                      
badlen                  xdrcall                 dupchecks              
0                       0                       0                      
dupreqs                
0                      

Server nfs:
calls                   badcalls               
83                      0                      
Version 2: (0 calls)
null                    getattr                 setattr                
0 0%                    0 0%                    0 0%                   
root                    lookup                  readlink               
0 0%                    0 0%                    0 0%                   
read                    wrcache                 write                  
0 0%                    0 0%                    0 0%                   
create                  remove                  rename                 
0 0%                    0 0%                    0 0%                   
link                    symlink                 mkdir                  
0 0%                    0 0%                    0 0%                   
rmdir                   readdir                 statfs                 
0 0%                    0 0%                    0 0%                   
Version 3: (78 calls)
null                    getattr                 setattr                
2 2%                    27 34%                  7 8%                   
lookup                  access                  readlink               
14 17%                  5 6%                    0 0%                   
read                    write                   create                 
1 1%                    3 3%                    7 8%                   
mkdir                   symlink                 mknod                  
0 0%                    0 0%                    0 0%                   
remove                  rmdir                   rename                 
6 7%                    0 0%                    0 0%                   
link                    readdir                 readdirplus            
0 0%                    0 0%                    4 5%                   
fsstat                  fsinfo                  pathconf               
0 0%                    2 2%                    0 0%                   
commit                 
0 0%                   
Version 4: (0 calls)
null                    compound               
0 0%                    0 0%                   
Version 4: (0 operations)
access                  close                   commit                 
0 0%                    0 0%                    0 0%                   
create                  delegpurge              delegreturn            
0 0%                    0 0%                    0 0%                   
getattr                 getfh                   link                   
0 0%                    0 0%                    0 0%                   
lock                    lockt                   locku                  
0 0%                    0 0%                    0 0%                   
lookup                  lookupp                 nverify                
0 0%                    0 0%                    0 0%                   
open                    openattr                open_confirm           
0 0%                    0 0%                    0 0%                   
open_downgrade          putfh                   putpubfh               
0 0%                    0 0%                    0 0%                   
putrootfh               read                    readdir                
0 0%                    0 0%                    0 0%                   
readlink                remove                  rename                 
0 0%                    0 0%                    0 0%                   
renew                   restorefh               savefh                 
0 0%                    0 0%                    0 0%                   
secinfo                 setattr                 setclientid            
0 0%                    0 0%                    0 0%                   
setclientid_confirm     verify                  write                  
0 0%                    0 0%                    0 0%                   
release_lockowner       illegal                
0 0%                    0 0%                   

Server nfs_acl:
Version 2: (0 calls)
null                    getacl                  setacl                 
0 0%                    0 0%                    0 0%                   
getattr                 access                  getxattrdir            
0 0%                    0 0%                    0 0%                   
Version 3: (5 calls)
null                    getacl                  setacl                 
1 20%                   4 80%                   0 0%                   
getxattrdir            
0 0%                   

/*列出所有输出的文件系统和哪些客户机可以访问哪个文件系统*/
acccsf#[/etc]showmount -e
export list for acccsf:
/home/nfs (everyone)

 

以后再附上NFS的概念知识,这里只进行了HPUNIX上的SAM配置,或者通过修改配置文件,就是需按流程仔细点。

 

 

Posted on 2011-06-24 12:20  Valley  阅读(663)  评论(0编辑  收藏  举报