Simple clustering of open source software with Veritas

By: on May 31, 2011

Veritas cluster server is often used in corporate environments to provide clustering and high availability. Veritas is a complex, closed source product that provides integration for lots of enterprise software such as SAP or Oracle, but it is very simple to use it to cluster open source software as well.

In order for Veritas to manage a piece of open source software you need to provide three scripts; a script to start the service, a script to stop the service and a script that monitors the status of the software. The start and stop scripts don’t need any special knowledge they just need to start and stop the service, if the application has an init.d script that should be sufficient for the start and stop script.

So if we have a mythical open source application called gherkin then the Veritas agent can be configured to use this as a start script:

/etc/init.d/gherkin start

and this for the stop script:

/etc/init.d/gherkin stop

Unfortunately Veritas doesn’t use standard UNIX return codes for monitoring it has its own numeric values, namely 110 for an active service and 100 for an inactive service, so you will need to provide a script to map the services status to these numbers.

For example if our mythical open source application returns status from its init.d script then we will need a script like this:

if /etc/init.d/gherkin status &> /dev/null; then 
    exit 110
    exit 100 

This maps a standard UNIX successful return code to the Veritas success code, 110, and everything else to the Veritas failure code, 100.


Post a comment

Your email address will not be published.


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>