a basic HA daemon - how it works

| | Comments (0) | TrackBacks (0)

i posted about the HA daemon earlier and wrote one now. this is how it works and what it does ... it is pretty basic but it does the job and if i have some time i'll grow it to a nice one.

the basic architecture

#cat checks.conf
[local]
check_db_host1
chech_db_host2

this defines a scope (local) and checks that should be run in this scope. currently it supports only local checks, remote checks could be implemented via ssh or via a daemon running those hosts.

#cat actions.conf
[slave_to_master]
stopservice1
unplumb
plumb %MASTER%
startservice1

this defines state changes. if the daemon sees a change for the host it monitors and the status has been "slave" before and now is "master" then these commands run in a fork. there are variables in the config file to indicate arguments like %MASTER% and %SLAVE% that get expanded to the according hostnames during runtime.

the daemon is based on the Net::Server framework that is the best framework for perl based daemons i ever worked with and that has proven to be reliable in high traffic environments during the last years already. i decided to maintain a internal basic hash table in a file based database to synchronize forks, this could move to a shared memory based solution but performance is not so much an issue in this setup so i decided that a file is good enough.

the checks are simple perl scripts that get called from a fork of the main daemon via "qx{}" and report the new status back to the daemon via a UNIX socket in for of a serialized hash.
the action scripts are simple perl scripts that, unlike the checks, are processed serial in the order defined in the config file. these shell scripts start/stop other daemons (un)/plumb network interfaces and so on.

the main goal is reached, a self contained daemon that can be copied to any location and run with near to no setup. all that has to be done is defining simple checks and configuring the state changes ... pretty straight forward.

0 TrackBacks

Listed below are links to blogs that reference this entry: a basic HA daemon - how it works.

TrackBack URL for this entry: http://who.wants.in/mt/mt-tb.cgi/19

Leave a comment

Side Blog

sidenote

i found a long searched feature for OS X today: sidenote is a note taking application that just works the way you like it

work environments

can be destructive or supportive. here are some fancy ones.

pictures ...

manu posted some pictures from otaki forks

no open source HAd

it is a pitty, not because the design is so nice but because of the fact that governmental entities are so 20th century from time to time ... the answer to the question if i am allowed to open source the HAd that i wrote they told me that "it is not the way we do it here" ... so, no, i can't release it. sorry

assembling RBLs

a nice article about assembling RBLs and setting up tarpits under free/openBSD an be found here

instantbird

a promising new jabber client based on mozilla and pidgin (which is still gaim for me) can be found here

DAViCal

the apple iCal server failed so i'll try the next one and give andrews daemon a go

iCal server

i got bored with different calendars and gave this one a try totday. success and failure will be reported.

russia the new silicon valley?

as nat wrote here on o'reilly radar russia tries to keep up with innovative new companies

google phone stack

the google phone stack is backed quite well by big players.

About this Entry

This page contains a single entry by lenz published on November 26, 2007 8:53 AM.

a HA daemon ... first ideas was the previous entry in this blog.

keeping track is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.