solaris cluster 3.2 application failover

creating a simple application-failover for SC3.2

Normally you would want to create a script that is
called by the start_method to initiate the application,
and a script that is called by the monitor_method
to check whether your application is still running.

 

In sun cluster 3.2 however, it is sufficient to just
create a start script. Monitoring is done by 'pmfadm'
if the application fails, pmfadm calls an action that
will fail-over the application to another node.

 

If you do want to monitor the application yourself, you
will have to change the start-method and change the
following line:

 

pmfadm -c $PMF_TAG -a "$action -R $RESOURCE_NAME -G $RESOURCEGROUP_NAME  -T $RESOURCETYPE_NAME" $start_cmd_args
to this:
 pmfadm -c $PMF_TAG -n 2 $start_cmd_args

 

This results in that the application will be restarted (-n 2) twice.
No action will be called. Your monitor script will detect that
the application has failed and a Give_Over will be initiated.

 

In this document pmfadm is left untouched, so there is no need
for a monitor script.
----------------------------------------------------------------------------

 

Step 1
Should be performed on all nodes that should be able to run
the application!
The application needs a configuration directory for its
scripts and other files.
mkdir /opt/SUNWklok
The application will get a startupscript and a monitorscript
vi /opt/SUNWklok/startklok
(startklok)
/usr/openwin/bin/xclock -display <aws-ip>:0
The script should be made executable
chmod +x /opt/SUNWklok/*

 

Step 2
Run the wizard "scdsbuilder" from /usr/cluster/bin
specify the vendor and the name of the resource-type
e.g. vendorname=SUNW resourcetype_name=klok
specify the directory to build the environment
for your ha-application
e.g: /opt/XCLOCK
click on "create"
then go on to the next screen.
specify the application-binary or script.
e.g. /opt/SUNWklok/startklok
This will create the resource-type package.
Make sure that you get the environment created in
/opt/XCLOCK/SUNWklok on the other nodes as
well. So for example go to /opt/CLOCK, tar
the tree from SUNWklok onwards and ftp to the other
nodes where you untar them again in /opt/XCLOCK.

 

Run pkgadd to install the resource type
pkgadd -d /opt/XCLOCK/SUNWklok/pkg
NOTE! pkgadd on all nodes!
On both nodes, change the following file:
/opt/SUNWklok/bin/klok_svc_stop.ksh
Find the following lines:
((SMOOTH_TIMEOUT=$STOP_TIMEOUT * 80/100))
((HARD=$STOP_TIMEOUT * 15/100))
and change them into:
((SMOOTH_TIMEOUT=5))
((HARD_TIMEOUT=5))
step 3.
register the resource-type
clrt register SUNW.klok
create the resource-group
clrg create klok-rg
create the resource
clrs create -g klok-rg -t SUNW.klok klok-rs
To be able to switch between nodes within the hour after a
failover, change the pingpong interval
clrg set -p Pingpong_interval=10 klok-rg
On the display server disable access control
xhost +
Manage and Online the resource group.
clrg manage klok-rg
clrg online klok-rg

 

Switch the klok resource group to the second node and back

 

clrg switch -n secondnode klok-rg
clrg switch -n firstnode klok-rg

 

Kill the clock on the first node:

 

pkill xclock

 

The clock will be restarted on the same node.
Kill it again. It will be restarted on the same node
for a second time. If you kill it a third time, it
will fail_over.
This entry was posted in solaris. Bookmark the permalink.

Comments are closed.