sun.com | docs.sun.com | How To Buy | My Sun | Worldwide Sites |  |

| Previous Contents Index Next
3. ### To Set `NLSPATH` Permanently Log in to the peer node on which you want to set up `NLSPATH`. Open the `/etc/profile` file in a text editor. Add the following lines to the `/etc/profile` file:
       LANG=C
       export LANG
       NLSPATH=/opt/SUNWcgha/lib/locale/%L/LC_MESSAGES/%N
       export NLSPATH
3. 1. Save the `/etc/profile` file and exit the editor. Source the `/etc/profile` file. ## Maintaining System Log Files This section describes how to manage large system log files and how to remove log files. Use tools such as `grep` to search the system log file and identify messages for a specific node. ### To Redirect System Log Messages to a Nonpeer Node This procedure redirects system log messages from peer nodes to the system log file on a nonpeer node, preventing the need to maintain large log files on peer nodes. Log in to a peer node as superuser. In a text editor, add the name of the nonpeer node to the `/etc/hosts` file. In a text editor, edit the `/etc/syslog.conf` file as follows: Remove the line:
          local0.info;local0.notice;local0.crit;local0.warning	/var/adm/logfile
   2. Add the line:
          local0.info;local0.notice;local0.crit;local0.warning 	@nonpeer
6. nonpeer is the name of the nonpeer node, as defined in the `/etc/hosts` file. You can replace `@nonpeer` with `@loghost` if `loghost` is defined in `/etc/hosts`. Repeat Step 1 through Step 3 on each peer node. Log in to the nonpeer node to which you want to redirect the messages. Create an empty file called `/var/adm/`logfile``:
       # touch /var/adm/logfile
8. Open the `/etc/syslog.conf` file in a text editor. Specify logfile as the destination for system log messages by adding the following line to the `/etc/syslog.conf` file:
       local0.info;local0.notice;local0.crit;local0.warning		/var/adm/logfile
9. Stop the `syslogd` daemon:
       # /etc/init.d/syslog stop
10. Restart the `syslogd` daemon:
        # /etc/init.d/syslog start
2. ### To Remove Links to Crashed Daemons Removing old log files might not be sufficient to free space. When a daemon crashes while writing to a log file, a link to the log file still exists after the death of the daemon. Consider the impact on a cluster before shutting down a daemon. Stop the daemon. Remove the link to the log file. Restart the daemon. ## Logging NFS Operations To log NFS operations, perform the following procedure. ### To Log NFS Operations Log in to the master node as superuser. Open the `/etc/nfs/nfslog.conf` file in a text editor and add this line:
       my-tag default_dir=my-dir logformat=extended
   my-tag | Label to identify NFS log messages
   my-dir | Directory where log of the NFS operations is located
3. Open the `/etc/dfs/dfstab` file in a text editor and add this line:
       share -o log=my-tag shared-nfs
   my-tag | Label to identify NFS log messages
   shared-nfs | Shared directory to which all NFS operations, such as `rm` and `mkdir`, are logged.
4. Restart the NFS server:
       # /etc/init.d/nfs.server start
5. Verify that the `shared-nfs` directory is being shared:
       # share
   An output similar to this is displayed in the console window:
       -               /share-nfs   log=my-tag   ""
6. Verify that the `nfslogd` daemon is running:
       # ps -ef | grep nfslogd
   - If the `nfslogd` daemon is running, output similar to this is produced:
         root   606   348  0 15:03:37 pts/2    0:00 grep nfslogd
         root   592     1  0 14:51:09 ?        0:00 /usr/lib/nfs/nfslogd
7. 2. If the daemon is not running, repeat Step 4 and Step 5. Test that NFS operations are being logged. Log in to a peer node other than the master node, as superuser. This node is referred to as node A. Mount the share-nfs directory:
          # mount master-node:/share-nfs /mnt
   4. Log in to the master node as superuser. Create a file:
          # touch myfile
          # chmod 777 myfile
   5. Log in to node A and examine myfile:
          # echo TEST myfile
   6. Examine the log files on the master node:
          # cat  /share-NFS/nfslog
You should see entries for the NFS operations that you have performed. Log in to the vice-master node as superuser. Repeat Step 2 through Step 7.
Previous Contents Index Next

Copyright 1994-2004 Sun Microsystems