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
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.
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,
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)
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)
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)
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)
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)