IRC Services with failover support

failoverircredundancy

I run a single server (call it 'server A') IRC 'network', and thank to the generosity of some friends, I have been given a second server ('server B') that I can run an IRCd on in order to provide redundancy in case server A crashes. This is fine, I can set up a round-robin DNS with the servers linked. The problem I have is what to do about services? Does anyone know of a way to get the services to 'fail over' in case of a server failure? Eg, Server A starts off running the services, but suddenly crashes. Server B detects this and starts its own copy of the services (ideally with the same configuration and data as the services on Server B)

One solution that comes it mind is to write a bot that each server runs, that sit in a channel periodically checking if the bot from the other server is in the channel. If it is, then all is well. If not, then failover. I would prefer not to have to code this myself though

We are currently using Unreal IRCd and Anope services on Linux

Best Answer

Short Answer: You can't with Anope (or any other services system I know of)

Long Answer: Your idea is a good one, and you may not have to code from scratch - you can probably take existing template code for simple IRC bots (e.g. in Python); they also wouldn't necessarily have to regularly poll the other bots but just process join/part/quit messages. You would, of course, have to deal with various race conditions in some way (e.g. netsplits, database access issues, etc)