If you want failover, then you probably need to look at an external program to manage that.
Heartbeat is one such program.
This handles one server freezing, crashing, etc.
Unfortunately this isn't much help for you, as I don't think it runs on Windows yet.
MS has
a clustering solution, but it's only on Win2k Advanced Server.
Unless you're already running advanced server, and can write a COM+ perl script, then your best solution may be to take the ideas of heartbeat and adapt them to your script.
Open up a TCP socket, and have the programs ping each other back and forth. Typically the secondary will ping the primary. If the primary doesn't respond, then the secondary should take over.
A few issues to watch out for:
Primary Stops (crashes or freezes or program dies)
Primary Stops, but comes back up after secondary takes over (secondary needs to stop, or primary needs to realize that they have switched roles)
Depending on the application, you will have to make sure that the switch from primary to secondary is invisible to the user, this usually involves ip address changes or dns tricks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.