HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

High Availability Basics

 
Dave Cast
Frequent Advisor

High Availability Basics

I'm thinking of setting up a High Availability Cluster -

Here's a brief description of my situation, I have a front end that serves up ssh connections to customers, I'd like to make it redundant in that I'd like to have a 'failover' server that would take over if that front end failed.


Here's my problem:
There are several cron jobs that run at specific times on this front end, if I were to setup a 'failover' server as part of a High Availability cluster where could I move those jobs too, as it wouldn't be good if they ran on both nodes of the cluster. However if I set them up on just one node, then I have a single point of failure, if that node goes down, those cron jobs will never run.

Today is different and tomorrow the same.
4 REPLIES
Tingli
Esteemed Contributor

Re: High Availability Basics

Pull those crontab jobs out from cron and run them as processes in loop.
Turgay Cavdar
Honored Contributor

Re: High Availability Basics

You can write a script which starts/stops the cron jobs.Then you can integrate this script into cluster package control script, so when your package starts it starts the cron for users, when the package stop it deletes the cron for users.

Start script should look like:
/usr/bin/crontab CRON

The file CRON should reside on a file system configured in the package, or you manually replicate it on all nodes. You shouldn't populate your crons with "crontab -e", you should first edit CRON file then use "/usr/bin/crontab CRON" to update crons.

stop script should look like:
/usr/bin/crontab -r
Johnson Punniyalingam
Honored Contributor

Re: High Availability Basics

As mentioned on the above post,

place all your several cron job under "Cluster pkg" mount points and your place crontab under "pkg.cntl.file" as shown below

function customer_defined_run_cmds
{
# ADD customer defined run commands.
: # do nothing instruction, because a function must contain some command.
/opt/smx/bin/rc/rchDB.pd1 s nv
/usr/sbin/inetd -c
/usr/bin/crontab /opt/smx/bin/cron/abc.cron
test_return 51
Problems are common to all, but attitude makes the difference
Rita C Workman
Honored Contributor

Re: High Availability Basics

Here's yet another way.

Put all your cronjobs where you do, in cron.
Now put all those same cronjobs on the other servers cron. Now you are going to set them up with one little 'difference'.

A good while back I came across a truly sleek script that Simon Hargrave wrote. What this does is goes out to see if the package is running on "this" node and runs the cron job. If the package isn't running then it does not run the job. Stephen Doud called the script elegant - and it is.

Take a look at this thread.....

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=886789&admit=109447626+1268158640672+28353475

We use it here on our cluster...

Kindest regards,
Rita