NFS Basic Configuration

Embed Size (px)

Citation preview

  • 8/9/2019 NFS Basic Configuration

    1/6

    Configuration

    The Configuration File Explained

    The main NFS configuration file is

    /etc/rc.config.d/nfsconf

    This is a user-editable file, so it is NOT overwritten by patches. So, if a patch is installedwhich contains a newer version of this file, the system administrator must backup theoriginal, copy the new file from /usr/newconfig/etc/rc.config.d/nfsconf, and then applythe same changes they have already made to the new version.

    Here are the configurable parameters, their default values, and what they do:

    NFS_CLIENT=1

    If this is set to 1, this system is considered an NFS client. At startup, the system will runrpcbind, the configured number of biod's, rpc.statd, rpc.lockd, and AutoFS or legacyautomounter (if configured)

    [ top ]

    NFS_SERVER=0

    If this is set to 1, this system is considered an NFS server. At startup, the system will runrpcbind, rpc.mountd, the configured* number of nfsd's, rpc.statd, rpc.lockd, and

    rpc.pcnfsd (if configured as a PCNFS_SEVER).

    [ top ]

    NUM_NFSD=4

    This is the number of nfsd's (server-side daemons) which are started when the NFS serveris started. There must be at least one nfsd per CPU, and the number of nfsd's must be amultiple of the number of CPU's. For example: if a system has 12 CPU's andNUM_NFSD=8, then we will automatically (and silently) start 12 nfsd's. If, on the samesystem, NUM_NFSD=14, we would start 24.

    [ top ]

    NUM_NFSIOD=4

    This is the number of biod's (client-side daemons) which are started when the NFS clientis started.

    http://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbook
  • 8/9/2019 NFS Basic Configuration

    2/6

    [ top ]

    PCNFS_SERVER=0

    If this is set to 1, this system is considered to be a server to PCNFS clients. At the startup

    of the NFS server, this will cause us to run rpc.pcnfsd.

    [ top ]

    LOCKD_OPTIONS=""

    These are options passed to rpc.lockd when it is started by the NFS client or serverscripts. Not all lockd options can be passed via the config file, however. Some optionsmay cause the startup script to hang.

    [ top ]

    STATD_OPTIONS=""

    These are options passed to rpc.statd when it is started by the NFS client or serverscripts. Not all statd options can be passed via the config file, however. Some optionsmay cause the startup script to hang.

    [ top ]

    MOUNTD_OPTIONS=""

    These are options passed to rpc.mountd when it is started by the NFS server script. Not

    all mountd options can be passed via the config file, however. Some options may causethe startup script to hang.

    [ top ]

    AUTOMOUNT=1

    If this is set to 1, this system will run either AutoFS or the legacy automounter. Theselection is determined by the setting of AUTOFS=n

    [ top ]

    AUTO_MASTER="/etc/auto_master"

    The master automount map file to be used by AutoFS or legacy automounter.

    [ top ]

    AUTO_OPTIONS="-f $AUTO_MASTER"

    http://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbook
  • 8/9/2019 NFS Basic Configuration

    3/6

    This is passed to AutoFS. You can see that it is sourced from the above variable.

    [ top ]

    START_MOUNTD=1

    This tells the system to start rpc.mountd when the NFS server is started. An alternative,but not recommended, method of running rpc.mountd would be via inetd.

    [ top ]

    AUTOFS=0

    If this is set to 1, and AUTOMOUNT=1, this system is considered to be an AutoFS clientand automountd is started when the NFS client is started via the nfs.client script.

    [ top ]

    AUTOMOUNT_OPTIONS=""

    These are options passed to the automount command at startup. Do not confuse thesewith options passed to the daemon, automountd.

    [ top ]

    AUTOMOUNTD_OPTIONS=""

    These are the options passed to the AutoFS daemon, automountd. Do not confuse these

    with options passed to the automount command.

    [ top ]

    NFS_TCP=1

    This is only on 11.00 systems where support for NFS over TCP has been added. If it isset to 1, this system is considered to be able to run NFS over TCP.

    [ top ]

    LOCKD_PORT=4045

    This fixes the port on which rpc.lockd will listen. This is a new feature that is used to fixthe port so that a firewall or other port filtering software can be easily configured to allowNLM traffic to pass through. Beginning with HP-UX 11.31, this will be hard-coded at4045, and not configurable.

    [ top ]

    http://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbook
  • 8/9/2019 NFS Basic Configuration

    4/6

    STATD_PORT=4046

    This fixes the port on which rpc.statd will listen. This is a new feature that is used to fixthe port so that a firewall or other port filtering software can be easily configured to allowNSM traffic to pass through. This port will remain configurable for the foreseeable

    future.

    [ top ]

    MOUNTD_PORT=4047

    This fixes the port on which rpc.mountd will listen. This is a new feature that is used tofix the port so that a firewall or other port filtering software can be easily configured toallow MOUNT traffic to pass through. This port will remain configurable for theforeseeable future.

    [ top ]

    For additional information about the configurable parameters in this file, please refer tothe file itself.

    [ top ]

    Client Configuration

    The NFS client is configured by settting

    NFS_CLIENT=1

    in

    /etc/rc.config.d/nfsconf

    You may also with to set other options which are described above.

    [ top ]

    Server Configuration

    The NFS server is configured by setting

    NFS_SERVER=1

    in

    /etc/rc.config.d/nfsconf

    http://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbook
  • 8/9/2019 NFS Basic Configuration

    5/6

    You may also with to set other options which are described above.

    [ top ]

    AutoFS and Legacy Automounter Configuration

    AutoFS (client) is configured by setting

    NFS_CLIENT=1AUTOMOUNT=1AUTOFS=1

    Note: If you are configuring a client which is also a server of an HA_NFSServiceGuard package, it is very highly recommended to use the -L option forautomountd as follows:

    AUTOMOUNTD_OPTIONS="-L"

    in

    /etc/rc.config.d/nfsconf

    [ top ]

    The legacy automounter (discontinued at 11.31) is configured by setting. We do notrecommend using the legacy automounter other than for testing/troubleshooting purposes.

    NFS_CLIENT=1AUTOMOUNT=1

    AUTOFS=0

    in

    /etc/rc.config.d/nfsconf

    [ top ]

    PC-NFS Server Configuration

    The PCNFS server is configured by setting

    NFS_SERVER=1PCNFS_SERVER=1

    in

    /etc/rc.config.d/nfsconf

    [ top ]

    http://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbook
  • 8/9/2019 NFS Basic Configuration

    6/6

    Other Config Files Which Affect NFS

    /etc/shells (used by rpc.pcnfsd)/etc/hosts/etc/passwd/etc/group

    /etc/netgroup/etc/nsswitch.conf/etc/fstab/etc/exports/etc/auto* (if an automounter client)

    [ top ]

    Startup and Shutdown

    Starting and stopping the NFS client

    The NFS client should ONLY be stopped and started by the following commands:

    /sbin/init.d/nfs.client stop/sbin/init.d/nfs.client start

    If any other method is used, problems such as commands hanging may occur and asystem reboot may be necessary. Caution should be used when stopping the NFS client.Any users who are working over NFS should be notified so that they can complete theirwork before the NFS client is stopped.

    [ top ]

    Starting and stopping the NFS server

    The NFS server should ONLY be stopped and started by the following commands:

    /sbin/init.d/nfs.server stop/sbin/init.d/nfs.server start

    If any other method is used, problems such as commands hanging may occur and asystem reboot may be necessary. Caution should be used when stopping the NFS server.

    Any users who are working over NFS should be notified so that they can complete theirwork before the NFS server is stopped.

    http://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbookhttp://wtec.cup.hp.com/~onc/NFS/nfs_cookbook.htm#NFS%20Cookbook%23NFS%20Cookbook