[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mirror applications on Linux Server



Miles Fidelman wrote:

> lrhorer wrote:
>> If there is a better forum for this, let me know and I will post my
>> questions there.
>>
>> I am building an application which needs to have high reliability.  I
>> have two essentially identical Linux servers which can host the
>> application.  Right now, I have the programs - a bash script and a c
>> binary, running on one machine every minute in a cron job.  I also
>> have an rsync cron job running to synchronize the files on the
>> standby
>> machine so the data (and binaries, of course) will be identical. 
>> What I need to do is have the standby machine take over operations if
>> the applications on the primary machine quite working, for whatever
>> reason. Of course I can easily ping the primary to make sure the
>> machine is up, but what is going to be my best bet for having the
>> standby machine wake up and start running the apps every minute until
>> such time as the
>> primary comes back online?  I'm wide open on how to implement.  An
>> external application would be great, or I could write either or both
>> c or shell apps to have the two machines talk to one another.
>>    
> It may be overkill, but take a look at Pacemaker and the Linux-HA
> Project - http://www.linux-ha.org - it's specifically intended for
> such applications.
> 
> Also look at DRBD - www.drbd.org - which mirrors a disk (or
> partition), in realtime across two machines.
> 
> The combination gives you automated fail-over capability.

        No, definitely not necessary.  The binaries and scripts, of course,
won't change very often, at all, after I am done with development.  The
whole application suite - data and all - is also quite small. 
Excluding the log files, the entire directory set is less than 300KB.
There are three sets of data files.  One is user data, generated by CGI
scripts running on the web server.  These only get modified at most
once or twice daily.  They are not critical, and any daily changes
evaporate after at most a few hours, anyway.  The second set is
schedule data, 9 small files which will usually only be changed
extremely rarely - once or twice a year at most.  The third set is
real-time data, all of which is overwritten every minute, except for
some non-critical log files.  It is critical the applications run
regularly, but it is not absolutely required the apps have perfectly
current data.

        These applications run an HVAC system. Failure to turn on or off the
air handlers for 15 minutes or so won't create a big problem, but being
down for several hours will most definitely cause a major issue.

> Now, if you want to get really fancy, you can run your application in
> a virtual machine, and use pacemaker and DRBD to fail-over the entire
> VM.

        No, I really don't want to get fancy.  KISS is the order of the day,
here.


Reply to: