Re: [Hampshire] High availability database

Top Page

Reply to this message
Author: Imran Chaudhry
Date:  
To: hampshire
Subject: Re: [Hampshire] High availability database
> Hi,
>
> I have a situation where I need to keep data on several PCs on a LAN in
> sync. Any PC may update the data, with suitable locking, which must be
> pushed out to all the others. It must be possible for a PC to go down
> and be brought back on line again without impacting the others. The
> amount of data is not large - say a few thousand items - and the
> population of PCs is also modest - maybe 50 of them. All will be running
> some version of Red Hat Linux.
>
> Has anyone worked on something along these lines?
>
> One option I have considered is using, say, MySQL with one master node
> replicating to all the others and some mechanism to elect a new master
> if the original went down. But, that sounds messy. There must be a
> neater solution?
>
> Bye for now,
> Chris.


Hi Chris,

I have set-up and maintained MySQL Master-Master configs which will
do something like that but I think it's going to be overkill although
that depends fully on what you need out of this system.

To keep things simple, I'm going to assume only one PC in the
"cluster" does an update at any one time. As you mention "just a few
thousand items" I'm thinking sqlite along with a cron that runs every
minute with a Perl script. This checks the stored MD5 of the sqlite
database (which is just one self-contrained file), if the MD5 is
different to the stored MD5 then this PC has updated the database and
it is pushed out to all the others. This also means that each PC has
the hostnames of every other and it's ssh keys in the authorized_keys
file of every other. It's still messy but each PC can effectively be
the "master" node and be written to. I think the maximum a PC can be
out of date with data here is about 2 minutes.

Regards,
Im