I need an idea on how to accomplish this: I have a cluster that I only want to run cron jobs on when its active.
I know the cron script can check for node status, but then I have multiple copies to maintain wheres my existing resources all reference config on the shard fs (httpd/sql etc) so a change on the active node makes that permanent on the next node.
Any idea how to do this?
Thanks! jlc
On Wed, 2010-03-31 at 00:33 +0000, Joseph L. Casale wrote:
What kind of cluster? the term cluster can mean almost anything these days.
Sorry, my bad. RHCS
I can tell you how I did it for a 2-node heartbeat cluster. I enabled the cron jobs on both servers, and had the following snippet at the top of each script:
[ ! -f /usr/local/etc/db_inc.sh ] && exit 3 . /usr/local/etc/db_inc.sh getactivestatus
if [ "${activestate}" = "no" ]; then exit 0 fi
So in the file /usr/local/etc/db_inc.sh, I would define a function that would return whether or not I was the active node. An example of this would be:
getactivestatus() { if [ `cl_status rscstatus` = "all" ]; then activestate="yes" else activestate="no" fi }
You'll need a command that determines the active/passive status for RHCS to put into the getactivestatus() function, then you should be all set...
-I
On 03/30/2010 11:45 PM, Joseph L. Casale wrote:
I know the cron script can check for node status, but then I have multiple copies to maintain wheres my existing resources all reference config on the shard fs (httpd/sql etc) so a change on the active node makes that permanent on the next node.
I dont quite get clearly what it is that you are looking to achieve here, but rather than cron - have you considered a more adept job scheduling / orchestrating tool ? there are some very nicely done open source ones out there.
- KB
I dont quite get clearly what it is that you are looking to achieve here, but rather than cron - have you considered a more adept job scheduling / orchestrating tool ? there are some very nicely done open source ones out there.
I have a filesystem that mounts only on the active node of an n-way rhcs based active/passive cluster. I want a scheduling system that can store its conf on the shared fs and be started by the cluster service.
I have an interim solution while I research, do you have any personal reco's for job scheduling daemons?
Thanks! jlc
On Tue, 2010-04-06 at 11:10 +0000, Joseph L. Casale wrote:
I dont quite get clearly what it is that you are looking to achieve here, but rather than cron - have you considered a more adept job scheduling / orchestrating tool ? there are some very nicely done open source ones out there.
I have a filesystem that mounts only on the active node of an n-way rhcs based active/passive cluster. I want a scheduling system that can store its conf on the shared fs and be started by the cluster service.
I have an interim solution while I research, do you have any personal reco's for job scheduling daemons?
--- A little learning curve involved [1]. Has all you need + more.
John
On 04/06/2010 12:10 PM, Joseph L. Casale wrote:
I have an interim solution while I research, do you have any personal reco's for job scheduling daemons?
For what you have in mind, I'd have thought going with either supervisord or torque would be ideal.
or as John pointed out, you could go down the route of building a messaging stack
-KB