twitter

How To's Tutorials

What is RCRON.. & How to Setup High Availability of cron Jobs Using RCRON

 

rcron is a  powerful  tool that helps  system administrators  in setting up cron jobs redundancy and failover over groups of machines. RCRON ensure that a job installed on several machines will only run on the active one at any time.

 

 

Working of RCRON …..

 

High Availability using RCRON ( One Node will be stamped as Active and Second Node will be stamped as Passive ) , Same cron configuration will be on both , only difference would be active/passive state in a file.

 

For automatic Switching of active/passive state , we will be using KEEPALIVED Daemon , which utilizes the keepalive signal for communication between 2 nodes. After a signal is sent, if no reply is received the link is assumed to be down.


In this scenario , One node is marked as KEEPALIVED master and second as KEEPALIVED backup. Master node will keep the rcron state active , and backup node will keep the rcron state as passive. As soon as the Master Node comes down , it will send a 0 priority signal to the Backup Node , which will switch over and behave as a MASTER NODE and consecutively mark rcron as active as soon as the master node comes up again , the Backup Node will switch over to backup mode .

 

Installation and Configuration Steps of RCRON On CentOS / RHEL

 

In My scenario I have Two Linux Machines , one is Primary and second one is Slave.

 

Step:1 Enable IP Forwarding on both the Nodes. Edit the file /etc/sysctl.conf & make the below change

 

net.ipv4.ip_forward = 1

# sysctl -p      ; Save the Changes without rebooting the Machine

 

Step:2  Add the EPEL Repository On Both Nodes

 

# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

 

Step:3 Install the  necessary packages on Both the Nodes

 

# yum install subversion byacc flex gcc

 

Step:4  If You getting internet from the proxy server , then set http_proxy for svn

 

# mkdir /root/.subversion/
#  vi ~/.subversion/servers
http-proxy-exceptions = *.example.com
http-proxy-host = www.example.com
http-proxy-port = 8080
http-compression = no

 

Step:5  If we are getting Internet connection directly , then skip proxy settings. Download the rcron software from SVN

 

# cd /root;
# svn co http://rcron.googlecode.com/svn/trunk rcron
# cd rcron/rcron
# ./configure
# make
# make install

 

Step:6  Create the directory on both the nodes

 

# mkdir /etc/rcron/

 

##############################################
For MASTER SERVER Setup RCRON.conf as follows

##############################################

 

#vi /etc/rcron/rcron.conf

 

# An arbitrary name
cluster_name        = cluster

# A file containing either the word "active" or the word "passive"
state_file          = /var/run/rcron/state

# The default state in case state_file can't be read
#default_state       = active
syslog_facility     = LOG_CRON
syslog_level        = LOG_INFO

# We can tune jobs niceness/priorities
nice_level          = 19

 

Click Here to Continue...

Bharat on, 2013-05-06 17:04:42
nice article
Post Your Comments
Name:
Email:
Comment:
Security Code  *
Enter Security Code  *
Can't read the image? click here to refresh