Cluster Node Auto Discovery

John Landahl john at landahl.org
Fri Jul 25 01:03:24 CEST 2003


codepunk at codepunk.com (Codepunk) wrote in message news:<f1fd7b3.0307222211.7ccadd97 at posting.google.com>...
> 
> I have written a specialized server in python and now I wish to look
> at making it scalable. To do this I wish to include automatic
> discovery of peer nodes operating on my network. Can anyone provide me
> a pointer as to how I do such a thing? By how to do it I mean how does
> something like that work at the network level?
> 
> ping scan the ip range?
> some sort of broadcast packet?
> udp request to entire ip range?
> 
> I am not asking for code just how is something like that typically
> done?

It depends on what you mean by "peer nodes".  Do you mean *any* node
in your local network?  Or do you mean other nodes running your
software?

If the former, ping scanning would probably be sufficient.  You might
want to make use of the nmap tool (http://www.insecure.org/nmap/) to
simplify the job.

However, if by "peer nodes" you mean only other nodes running your
software, you might want to use Service Location Protocol (SLP,
defined by RFC 2608).  Take a look at OpenSLP
(http://www.openslp.org/) for an open source implementation.  There's
a Python wrapper (available in the "misc" directory of the
distribution, IIRC) which works quite well, and which condenses all
the C code to a .so for use by Python.  The advantage there is that
you don't need to distribute the entire OpenSLP package separately,
you only need to distribute the Python OpenSLP code itself (which can
easily be turned into a tarball via "python setup.py bdist").




More information about the Python-list mailing list