C H A P T E R 2 |
Information, error, and alert messages are logged to system log files. Use the system log files to diagnose problems or errors. By configuring the log files, you can direct different categories of messages to files or to the console window. This makes the information in logs more accessible and prevents the occurrence of large log files.
For information about using log files generated by the Solaris Operating System and the Foundation Services, consult the syslog.conf4 and syslogd1M man pages.
For information about using log files generated by the Linux Operating System and the Foundation Services, consult the syslog.conf5 and syslogd8 man pages.
All information, error, and alert messages generated by the Foundation Services are sent to the system log files. The messages can be processed by client programs or by the Node Management Agent (NMA) on Solaris systems (NMA is not provided for Linux systems). To configure your access to the system log files, edit the/etc/syslog.conf file. You can add or change the message sources, priorities, and message locations according to the syntax described in the syslog.conf4 man page on the Solaris OS or the syslog.conf5 man page on Linux. See the man pages of the individual daemons for details of the error levels used by each service.
All Foundation Services messages have the syslog facility set to local0. You can configure system log files to contain selected categories of messages. Netra HA Suite software has the following error message categories:
For information about error message categories, see the syslog.conf4 man page.
To Redirect Netra HA Suite Messages to a File on the Master Node |
Log in as superuser to the node for which you want to redirect messages.
To redirect the info and notice messages to a log file called logfile, add the following line to the /etc/syslog.conf file:
local0.info;local0.notice /var/log/logfile |
Create a /var/adm/logfile file if this file does not already exist:
# touch /var/log/logfile |
For versions of the Solaris OS earlier than version 10:
# /etc/init.d/syslog stop # /etc/init.d/syslog start |
For the Solaris 10 OS and later:
# svcadm restart svc:/system/system-log |
# /etc/rc.d/init.d/syslog stop # /etc/rc.d/init.d/syslog start |
This procedure configures messages to be sent to a specific node. Use this procedure to prevent disruption of Network File System (NFS) traffic by high volumes of messages from diskless nodes.
Note - Netra HA Suite does not support diskless Linux nodes. |
In a text editor, open the /etc/hosts file for the diskless node.
If your cluster was created by the nhinstall tool, the /etc/hosts file is located at /export/root/diskless-node-name/etc/hosts.
Enter the loghost state for the cgtp0 address of the master node.
10.x.3.y master loghost |
If the master node is using a default class C address, 10.x.3.y is the IP address of the cgtp0 interface. The system log messages are directed to the logfile specified for the master node.
For versions of the Solaris OS earlier than version 10:
# /etc/init.d/syslog stop # /etc/init.d/syslog start |
For the Solaris 10 OS and later:
# svcadm restart svc:/system/system-log |
# /etc/rc.d/init.d/syslog stop # /etc/rc.d/init.d/syslog start |
System log messages are sent to the node specified in the /etc/hosts file. The node can be the current node or any other peer node. On the specified node, the messages are logged to a file called logfile, specified in the /etc/syslog.conf file. For information about redirecting messages to a nonpeer node, see To Redirect System Log Messages to a Nonpeer Node.
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.
This procedure redirects system log messages from peer nodes to the system log file on a nonpeer node. This prevents the need to maintain large log files on peer nodes.
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:
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 |
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 |
For versions of the Solaris OS earlier than version 10:
# /etc/init.d/syslog stop # /etc/init.d/syslog start |
For the Solaris 10 OS and later:
# svcadm restart svc:/system/system-log |
# /etc/rc.d/init.d/syslog stop # /etc/rc.d/init.d/syslog start |
To log NFS operations, perform the following procedure.
Open the /etc/nfs/nfslog.conf file in a text editor and add the following line:
my-tag default_dir=my-dir logformat=extended |
my-tag | is the label to identify NFS log messages |
my-dir | is the directory that contains the log of the NFS operations |
Open the /etc/dfs/dfstab file in a text editor and add the following line:
share -o log=my-tag shared-nfs |
my-tag | is the label to identify NFS log messages |
shared-nfs | is the hared directory to which all NFS operations, such as rm and mkdir, are logged. |
For versions of the Solaris OS earlier than version 10:
# /etc/init.d/nfs.server start |
Verify that the shared-nfs directory is being shared:
# share |
You will see output similar to the following displayed in the console window:
- /share-nfs log=my-tag "" |
Verify that the nfslogd daemon is running:
# ps -ef | grep nfslogd |
Test that NFS operations are being logged.
Log in as superuser to a peer node other than the master node.
Mount the share-nfs directory:
# mount master-node:/share-nfs /mnt |
# touch myfile # chmod 777 myfile |
Log in to node A and examine myfile:
# echo TEST myfile |
Examine the log files on the master node:
# cat /share-NFS/nfslog |
You should see entries for the NFS operations that you have performed.
Copyright © 2008, Sun Microsystems, Inc. All rights reserved.