| United States-English |
|
|
|
![]() |
Installing and Administering NFS Services with 10.20 ACE and HWE: HP 9000 Networking > Chapter 2 Configuring and Administering
NFSConfiguring and Administering an NFS Server |
|
An NFS server is a machine that "exports" its local directories (makes them available for client machines to mount using NFS) On the NFS client, these mounted files and directories look to users like part of the client's local file system. An NFS server can also be an NFS client. Following are the tasks involved in configuring and administering an NFS server. The first two tasks are the only ones required to get your server up and running. This section tells you how to perform these tasks, by editing files and issuing HP-UX commands. However, Hewlett-Packard recommends that you use SAM to configure and administer NFS. SAM (System Administration Manager) is Hewlett-Packard's windows-based user interface for performing system administration tasks. To run SAM, type sam at the HP-UX prompt. SAM has an extensive online help facility.
You can issue the exportfs -i command to add the directory to your server's internal list of exported directories, without adding the directory to the /etc/exports file. However, it will stop being exported when you reboot your system or restart NFS, unless you also add it to the /etc/exports file. (Issuing the exportfs command does not change the contents of the /etc/exports file.) Type man 1M exportfs for more information. You cannot export a directory and its ancestor or descendant, if they are on the same disk or logical volume. For example, if you are exporting the root directory (/), you cannot also export /opt, unless / and /opt are on different disks or logical volumes. Likewise, if you are exporting /opt/frame, you cannot also export /opt unless /opt/frame and /opt are on different disks or logical volumes. However, if a directory and its ancestor or descendant are on different disks or logical volumes, and you want to export both of them, you must export them using two separate entries in /etc/exports. Use the bdf(1M) command to determine whether your file systems are on different disks or logical volumes. Each line in the bdf output is a separate disk or volume that requires its own entry in /etc/exports if you want to export it. The /etc/exports file should be owned by root and have mode 644 (-rw-r--r--). The export options that restrict access to an exported directory are applied in addition to the regular HP-UX permissions already in place on that directory. For example, if only the owner of a file has permission to write to it, nobody else can write to the file, even if it is exported to the world with read/write permission. Access permissions may also be specified on the NFS client when a directory is mounted. If these permissions are different from the permissions for the exported directory on the NFS server, the more restrictive permissions are used. It is not a good idea to export a directory if it contains a symbolic link that points outside the exported directory. Once the directory is mounted on an NFS client, the symbolic link will be resolved locally on the client, so the destination of the symbolic link must exist on the client as well as the server. If the destination of the symbolic link does not exist on the client, a No such file or directory message will be displayed whenever anyone attempts access to it. Figure 2-1 “Symbolic Links in NFS Mounts” illustrates the problem of symbolic links in NFS mounts, where the destination of the symbolic link exists on the NFS server but might not exist on the NFS client. The following example exports the /usr/bin directory to NFS clients cabbage, cauliflower, and broccoli. Users on client broccoli have read/write access to the /usr/bin directory. Users on cabbage and cauliflower have read-only access. In addition to the export options, the HP-UX permissions for the /usr/bin directory must be set to allow access to the world or to a group that includes the users on broccoli, cabbage and cauliflower.
The following example allows all NFS clients read-only access to the directory /usr/share/man. The /usr/share/man directory must also allow read access to NFS users (for example, with -r--r--r-- permissions).
The following example exports the /var/mail directory. It allows root access to clients sage, thyme, and basil. The root users on all other NFS clients are considered "unknown" to the NFS server, so they are given the access privileges of user nobody. Non-root users on all NFS clients are allowed read/write access to the /var/mail directory, if the HP-UX permissions on the /var/mail directory allow them read/write access.
The following example exports the private root directory of diskless client sage. It allows root access to the root user on client sage. All other users on client sage have read/write access, if they are allowed read/write access through the regular HP-UX permissions. Users on other NFS clients have read-only access, if they are allowed read access through the HP-UX permissions.
In the following example, any user without a valid user ID who attempts access to client basil's private root directory will receive an RPC authentication error, because anonymous access is denied with the anon=65535 option. The root user on client basil is allowed root access to the directory, but the root users on all other machines are treated as "unknown" and denied access. The non-root users on all NFS clients are allowed read/write access, if the HP-UX permissions on that directory allow them read/write access.
The following example exports the /export/newsletter directory to all NFS clients. Root users will be given the effective user ID of 200. Other anonymous users will keep their own user IDs (even though they do not exist in the NFS server's passwd database), but they will be given the access permissions associated with user ID 200. If a root user is allowed to create a file in this directory, the ls command will show that it is owned by user ID 200. If an anonymous user with a non-zero user ID (for example, 840) is allowed to create a file in this directory, the ls command will show that it is owned by user ID 840.
The following example exports the /opt/frame directory to all NFS clients. Non-root users have read/write access (if the regular HP-UX permissions allow it), and root users are given the access privileges of user nobody. NFS writes are done asynchronously; that is, when an NFS client writes data to a mounted directory, the server returns a response before writing the data to disk. This allows the client to continue processing without waiting for the write request to complete.
The NFS startup script uses the variables in /etc/rc.config.d/nfsconf to determine which processes to start. The START_MOUNTD variable causes the NFS startup script to start rpc.mountd, the mount daemon. For more information, see the following man pages: mountd(1M) and inetd.conf(4).
If you unexport a directory that an NFS client currently has mounted, the next time someone on that client requests access to the directory, NFS will return an NFS stale file handle error message. The client may be able to unmount the directory, but if that does not work, the client must reboot to recover. For more information, see the following man pages: showmount(1M), fuser(1M), umount(1M), and exportfs(1M), automount(1M), make(1), and ypmake(1M).
The PCNFS_SERVER flag causes the NFS startup script to start the PC NFS server daemon, pcnfsd. As a PC NFS server, your system can export its directories and files to PC NFS clients. Following are some reasons why you might want to create an /etc/pcnfsd.conf file: The /etc/pcnfsd.conf file is read when the pcnfsd daemon starts up. If you make any changes to /etc/pcnfsd.conf while pcnfsd is running, you must restart pcnfsd before your changes will take effect. A PC must have NFS client software installed in order to use your system as a PC NFS server. For more information on pcnfsd, type man 1M pcnfsd at the HP-UX prompt.
If your NFS server will be down for only a very short period of time, this procedure is not necessary. If the server is down for only a few minutes, and directories are hard-mounted on the clients, clients attempting access to the server will simply hang until it comes back up. Then, they will resume access to it as if nothing had happened. However, if the server will be down for a long time, NFS clients attempting access to it will have to interrupt their attempts, usually with [CTRL]-C. If directories are mounted with the nointr option, clients must reboot their systems in order to stop trying to access a down server. See the following man pages for more information: showmount(1M), fuser(1M), exportfs(1M), automount(1M), and mountd(1M). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||