A Clustering Daemon for Linux http://yakk.ucc.asn.au/clusterd/ Copyright 2000, Ian McKellar Clustering is the idea of making several computers act as one for the purposes of either performance or reliability. I'm personally more interested in reliability than performance. This system guarantees that a response will be serviced provided at least one cluster node is up. You must allocate a local, unused IP address to be the cluster address. The clusterd program will hash this to produce a MAC address for the cluster. You must allocate a local, unused IP address to each cluster member to use as a virtual interface address. Each cluster member needs a unique virtual interface address. To start the cluster daemon type (as root): clusterd Any TCP or UDP connections to the cluster IP will be shared between the cluster members. The implmementations are currently buggy and leak quite a lot. HOW TO BUILD: It requires libpcap and glib. Edit the Makefile with the locations of these packages. Then type `make'. HOW IT WORKS: There is no front-end box in this cluster. There are no heartbeats. This cluster uses what I call `claim packets'. When a new session is started (either because a TCP packet with SYN set arrives or because a UDP packet from a host:port combination that hasn't been seen before arrives) instead of handling the packet immediately, the packet is queued and a special IP packet is sent to the cluster IP. This packet, the claim packet has IP protocol number 150 and contains the source address, source port, destination port and protocol of the new session. When a claim packet is recieved, the cluster member checks to see if the claim packet is for a session that has already been claimed (if it is, then it is ignored) and if the packet originated from itself. If the first claim packet for a particular session originated from the recieving server, then that server handles the session. Because ethernet is basically a shared broadcast medium all machines on the network will recieve packets in the same order. This provides the distributed locking that the cluster requires. Other advantages of this approach include: * To add a member to the cluster you simply have to run the clusterd on it, no configuration is required. * If a host crashes then it will stop sending claim packets and stop being allocated sessions. * If a host is loaded or slow then it will respond more slowly than an unloaded or fast host, and hence be less likely to be allocated a session. * The clustering software requires no kernel modifications and runs entirely in user-space. This also means that the software should be portable to any platform that has libpcap and raw sockets. The current implementation has many leaks and is quite buggy. It is more of a proof of concept than a final implementation. It is certainly very unsuitable for production use. NOTE: ARP table hacks are an important part of this system, however the user doesn't need to care because clusterd responds to ARP requests for the cluster IP address, and on startup is inserts appropriate entries into the member ARP table.