Customizing the Sun cluster scripts for Infrastructure Management high-availability
The scripts are generated while creating the cluster resource type. On each node in the cluster, edit the appropriate scripts to achieve the following tasks:
- Disable the PMF monitoring
- Get the proper license files
- Start the Infrastructure Management application
- Enable the cron jobs
The scripts are available under the /bin directory of the Solaris package generated by the agent builder.
To customize scripts to achieve high-availability
- Open the start script (resourceType_svc_start.ksh) for editing.
- Disable the PMF monitoring by entering the following command:
pmfadm -s $PMF_TAG -a "$action -R $RESOURCE_NAME -G $RESOURCEGROUP_NAME-T $RESOURCETYPE_NAME" $start_cmd_args
The daemon under the control of the Sun Cluster Process Monitor Facility starts. Let it crash and invoke the action script provided. The action script will restart the resource or enable high-availability and will return a non zero exit status to cease the process monitor facility. - At the end of the PMF monitoring command in resourceType_svc_start.ksh file, add the following lines under the User added code placeholder section and before the line "exit 0."
# User added code — BEGIN
update_license_file
/usr/pw/pronto/bin/pw system start
enable_cron
# User added code — END - Copy the node-specific license files to the /usr/pw/licensesdirectory and add the appropriate extension as follows:
- Rename the license files targeted to the primary node with the extension .primary.
- Rename the license files targeted to the secondary node with the extension .secondary.
The files should look as follows:
/usr/pw/licenses/*.primary
/usr/pw/licenses/proactivenet.lic.primary
/usr/pw/licenses/proactivenet.sign.primary
/usr/pw/licenses/*.secondary
/usr/pw/licenses/proactivenet.lic.secondary
/usr/pw/licenses/proactivenet.sign.secondary
- Above MAIN in the start script, provide the proper licenses and enable cron jobs for Infrastructure Management as described in the following steps:
- On the primary node, update the license files by entering the following commands:
update_license_file() {
cp /usr/pw/licenses/proactivenet.lic.primary
/usr/pw/licenses/proactivenet.lic
cp/usr/pw/licenses/proactivenet.sign.primary
/usr/pw/licenses/proactivenet.sign} - On the secondary node, update the license files by entering the following commands:
update_license_file() {
cp /usr/pw/licenses/proactivenet.lic.secondary
/usr/pw/licenses/proactivenet.lic
cp /usr/pw/licenses/proactivenet.sign.secondary
/usr/pw/licenses/proactivenet.sign} - Create a cron folder in the /usr/pw/ directory and a file called cron_entries in the /usr/pw/cron/ directory and add the following lines:
# begin_pronto — DO NOT DELETE THIS LINE!
#
# the following entry is added for Infrastructure Management
## Changed on Mar 13, 2009 10:31:53:AM PST
#
# 15 * * * * /usr/pw/pronto/bin/hourlyjobs >
/usr/pw/pronto/tmp/hrjob.log
2>&1
30 3 * * 1-6 /usr/pw/pronto/bin/dailyjobs hosts >
/usr/pw/pronto/tmp/dajob$$.log
2>&1
30 4 * * 0 /usr/pw/pronto/bin/weeklyjobs hosts >
/usr/pw/pronto/tmp/wkjob$$.log
2>&1
30 5 * * 0 /usr/pw/pronto/bin/pw database archive
/usr/pw/dbarchive
send-email >
/usr/pw/pronto/tmp/dbarchive$$.log 2>&1
0,15,30,45 * * * * /usr/pw/pronto/bin/check_pronetprocs >
/usr/pw/pronto/tmp/che
ck_pronetprocs.log 2>&1
## end_pronto — DO NOT DELETE THIS LINE! - To enable the cron jobs, specify the following path in the start script:
enable_cron() {
crontab -l > /tmp/$$current_cron
while read line; do
echo "$line" >> /tmp/$$current_cron
done < /usr/pw/cron/cron_entries
crontab < /tmp/$$current_cron
rm /tmp/$$current_cron
}
- On the primary node, update the license files by entering the following commands:
- Save and close the start script.
- Open the stop script (resourceType_svc_stop.ksh) and edit it to disable the cron jobs and stop the Infrastructure Management application as described in the following steps.
- Add the following lines to the stop script:
# The Data service is not running as of now. Log a message and
# exit suceess.
# SCMSGS # @explanation
# Need explanation of this message!
# @user_action # Need a user action for this message.
scds_syslog -p error -t "${SYSLOG_TAG}" -m
"resourceType not already running"
/usr/pw/pronto/bin/pw system stop
disable_cron
# Even if the resourceType is not running, we exit success,
# For idempotency of
# the STOP method.
exit 0 - Above the Main section in the stop script, add the following function:
disable_cron() {
crontab -l | sed -e /begin_pronto/,/end_pronto/d > /tmp/$$pronto
crontab < /tmp/$$pronto
rm /tmp/$$pronto
}
- Add the following lines to the stop script:
- Save and close the stop script.
- Open the probe script (resourceType_probe.ksh), and add the following lines to support manual shutdown of the Infrastructure Management application:
if [[ -e "/usr/pw/pronto/tmp/system.start" ]]; then
if [[ -f $probe_cmd_prog && -x $probe_cmd_prog ]];
then hatimerun -t $PROBE_TIMEOUT $probe_cmd_args
# User added code — BEGIN vvvvvvvvvvvvvvv
# User added code — END ^^^^^^^^^^^^^^^
else
# We were not supplied with a probe command. We will use the
# simple_probe that comes bundled as an utility.
hatimerun -t $PROBE_TIMEOUT $RT_BASEDIR/simple_probe
-R $RESOURCE_NAME -G $RESOURCEGROUP_NAME
-T $RESOURCETYPE_NAME
# User added code — BEGIN vvvvvvvvvvvvvvv
# User added code — END ^^^^^^^^^^^^^^^
fi
else
continue
fi - Save and close the probe script.
Where to go next
Running-Infrastructure-Management-in-high-availability-cluster-mode
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*