Multiple incrond on "same" storage

From: Nicolas Bélan <nicolas.belan_at_gmail.com>
Date: Fri, 03 Feb 2012 12:16:08 +0100

Hello the list,

I have solved the following problem (or I hope to have ....)

I have a HA storage using OCFS2 cluster. So, I have two servers
accessing the same data on the same filesystem.
incrond is used to monitor xml files to import them on a noSQL DB.

To be sure that in case of failure, data are still imported, I have to
run incrond on both storage nodes, but only one can insert data into the DB.

I wrote this little patch on my CentOS 6-64, which starts a network thread.
This thread uses multicast to announce an ID. The lowest is the "master"
instance.
Only master can process event on the server.
If the master dies, a slave is elected "master" if it does not received
any annouce.
It the master restart sending packet, the master with a higher ID become
a slave.

The code is here : http://pastebin.com/Ym2SA5NZ

This is just a contribution, use it at your own risks ;-)

Best regards,
Nicolas
Received on Tue Jun 05 2012 - 22:14:21 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST