Thursday, August 06, 2009

A note about VCS in our environment

I was asked by a fellow DBA:
1. how to findout whether the server is in a cluster or not
2. If so how to find out what are the servers in the cluster

His question is general, however in our environment I know we use VCS.

I guess we can do ps -ef | grep had at least, if we see the had deamon is running, we have a good reason to believe the server is in the cluster.

e.g.

$ ps -ef | grep had

root 23555 1 0 Jul 12 console 126:03 /opt/VRTSvcs/bin/had
root 23557 1 0 Jul 12 console 0:00 /opt/VRTSvcs/bin/hashadow

There is a VCS configuration file called /etc/VRTSvcs/conf/config/main.cf. The file contains the information that defines the cluster and its systems. Unfortunately DBA does not have permission to read it. There is a command: hastatus -summary , which should be give us the summary information about the cluster. Again, we don't have permission to run it. However I found we had a log file under the VCS log directory, and it is readable by all, the contents are as follows:



ourservpd1:/var/VRTSvcs/log [ourdb] $ cat hastatus.summary

-- SYSTEM STATE
-- System State Frozen

A ourservpd1 RUNNING 0
A ourservpd2 RUNNING 0

-- GROUP STATE
-- Group System Probed AutoDisabled State

B online_failover ourservpd1 Y N ONLINE
B online_failover ourservpd2 Y N OFFLINE
B report_static ourservpd2 Y N ONLINE





It is clear from this log about what servers are involved in the cluster.

No comments: