Custom HA agent - Red Hat Linux Cluster


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Custom HA agent - Red Hat Linux Cluster
# 1  
Old 09-21-2010
Custom HA agent - Red Hat Linux Cluster

Hi experts, I have some custom application which I need to make Highly Available using red hat cluster service. How do I do it? i know in /usr/share/cluster i shall find HA agents for well known services like Apache or Sybase but I want to write HA agent for my own. I tried looking up on internet, and red hat documentation but couldn't find any systematic resource for the same. In system-config-cluster; I see a resource named script. Do I have to use this script resource for my custom application? If yes, I already did that. I wrote a script using apache.sh (found in /usr/share/cluster) and provided path of that script in resource config ( custom script is wrapper to start httpd daemon which bind to loop back address,stop this daemon and check its status). But i am unable to start it through cluster, i have added some ocf_log messages in script(for debugging) and they are not coming in /var/log/messages either. Any help, links, pointers would be greatly appreciated
# 2  
Old 09-21-2010
Does the attached configuration guide for Red Hat clusters help?
# 3  
Old 09-22-2010
Hi Neo

Cluster Admin Guide doesn't speak about setting up 'custom HA agent' or HA for custom applications.

Referring to this guide, i have successfully set up my 2-node red hat cluster; and have set up Apache service for HA

Now I want to learn or know how to make custom HA scripts, there is apache.sh in /usr/share/cluster and I was hoping to write my own using it, i did it as well however it seem not working.

I need some guidance as to how to achieve this(writing custom HA script), any inputs will be of great help.
# 4  
Old 09-22-2010
Have you looked at the templates provided by Red Hat for writing custom failover scripts?
# 5  
Old 09-23-2010
Hi fpmurphy

I looked in /usr/share/cluster/script.sh (and I think that's the template for custom app failover?). Here is how it looks like

Code:
#
# Script to handle a non-OCF script (e.g. a normal init-script)
#

LC_ALL=C
LANG=C
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export LC_ALL LANG PATH

. $(dirname $0)/ocf-shellfuncs

meta_data()
{
    cat <<EOT
<?xml version="1.0"?>
<resource-agent version="rgmanager 2.0" name="script">
    <version>1.0</version>
.....
}

case $1 in
        meta-data)
                meta_data
                exit 0
                ;;
        *)
                ;;
esac

[ -n "${OCF_RESKEY_file}" ] || exit $OCF_ERR_ARGS      # Invalid Argument
[ -f "${OCF_RESKEY_file}" ] || exit $OCF_ERR_INSTALLED # Program not installed
[ -x "${OCF_RESKEY_file}" ] || exit $OCF_ERR_GENERIC   # Generic error

# Don't need to catch return codes; this one will work.
ocf_log info "Executing ${OCF_RESKEY_file} $1"
${OCF_RESKEY_file} $1

declare -i rv=$?
if [ $rv -ne 0 ]; then
        ocf_log err "script:$OCF_RESKEY_name: $1 of $OCF_RESKEY_file failed (returned $rv)"
        exit $OCF_ERR_GENERIC
fi

Using above template i have created 'dummy_service.sh' and added status, start, stop, verify-all, monitor options in it (looking at apache.sh) to start, stop, monitor, verify my application is running (actually i am just trying to start httpd and stop it for now before going to more complex custom app)

If you like I can attach that script too.

Thanks

---------- Post updated 23-09-10 at 12:57 AM ---------- Previous update was 22-09-10 at 11:25 PM ----------

Alright it seems like 'script.sh' is not template for custom failover script

It is actually a resource agent for 'script' resource, in this script resource we need to provide path for /etc/init.d/<my script>

However this is a bit limiting, there are some unknown caveats like how to find out a node from which service is failed over (name of node on which service was previously running) and accessing shared resources (e.g. floating IP addresses)

---------- Post updated at 06:30 AM ---------- Previous update was at 12:57 AM ----------

I was able to set up custom HA agent; looking at few more options,

Thanks

Last edited by pshaikh; 09-23-2010 at 01:32 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Fedora

Which is the better platform to learn UNIX/Linux (Kali Linux Vs. Red Hat or other)?

I just started a new semester and I started my UNIX class yesterday. I've already decided to use python along with my learning process but what I really want to use with it is Kali as my UNIX/Linux platform to learn off of since I already wanted to learn Cyber Sec. anyways. I just wanted to know if... (12 Replies)
Discussion started by: ApacheOmega
12 Replies

2. Red Hat

Red Hat High Availability (HA) Cluster

How can we implement a service in HA, which in not available in HA. like sldap or customize application. Requirement Details. NODE1 service slapd is running.(Require) NODE2 service slapd is running.(Require) on both the node replication is happening. Now here requirement is need... (2 Replies)
Discussion started by: Priy
2 Replies

3. UNIX and Linux Applications

Configuration of Linux cluster managment on Red Hat 5.x server

Hi Experts, I have question regarding linux cluster managment on Red Hat 5.x server. When I try to install 'luci' or 'ricci' in one of our linux servers it is giving me below error:- yum install luci Loaded plugins: katello, product-id, rhnplugin, security, subscription-manager Updating... (0 Replies)
Discussion started by: Amey Joshi
0 Replies

4. Red Hat

Red Hat Cluster Luci Authentication Failed

Hello everyone, I'm setting up a cluster with 2 nodes using Red Hat enterprise 6.2 x86_64, 1 luci and 1 ricci for education purpose. Ricci is installed and already running and luci is installed and running but at the time of add and create the cluster through the web gui it give me a error... (1 Reply)
Discussion started by: typeav
1 Replies

5. UNIX for Dummies Questions & Answers

how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ?

how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ? (2 Replies)
Discussion started by: ahmedamer12
2 Replies

6. Red Hat

Free Cluster software with Red Hat Linux 5.0

Hi, I would like to know wheather any free cluster software is coming with Red Hat Ent Linux Medias? or needs to be purchased seperately. (3 Replies)
Discussion started by: manoj.solaris
3 Replies

7. Linux

Red Hat cluster

hi... I'm new to clustering concept, there was a issue in redhat clustering as "unable to load cluster.xml no such file or directory".. this issue restrict me from starting the cluster services and too execution of clustat command .. myself using vmware work station for the cluster setup with... (4 Replies)
Discussion started by: sriniv666
4 Replies

8. Red Hat

The Red Hat Cluster Manager Installation and

Linux RedHat Cluster Manager InstallationAdministrationGuide (0 Replies)
Discussion started by: merlin
0 Replies
Login or Register to Ask a Question