Friday, April 24, 2009

FILE_PING: new discovery protocol based on shared storage

I've just created a first version of FILE_PING in 2.6 and 2.8. This is a new discovery protocol which uses a shared directory into which all nodes of a cluster write their addresses.

New nodes can read the contents of that directory and then send their discovery requests to all nodes found in the dir.

When a node leaves, it'll remove its address from the directory again.

When would someone use FILE_PING, e.g. over TCPGOSSIP and GossipRouter ?

When IP multicasting is not enabled, or cannot be used for other reasons, we have to resort to either TCPPING , which lists nodes statically in the config, or TCPGOSSIP, which retrieves initial membership information from external process(es), the GossipRouter(s).

The latter solution is a bit cumbersome since an additional process has to be maintained.

FILE_PING is a simple solution to replace GossipRouter, so we don't have to maintain that external process.

However, note that performance will most likely not be better: a shared directory e.g. on NFS or SMB requires a round trip for a read or write, too. So if we have 10 nodes which wrote their information to file, then we have to make 10 round trips via SMB to fetch that information, compared to 1 round trip to the GossipRouter(s) !

So FILE_PING is an option for developers who prefer to take the perf hit (maybe in the order of a few additional milliseconds per discovery phase) over having to maintain an external GossipRouter process.

FILE_PING is part of 2.6.10, which will be released early next week, or it can be downloaded from CVS (2.6. branch) or here. In the latter case, place the into the src/org/jgroups/protocols directory and execute the 'jar' target in the build.xml Ant script of your JGroups src distro.


  1. I forgot to say that the protocol can be configured (in addition to the default properties of Discovery) with location, e.g.:


    The latter properties defines the root directory for all files

  2. Hello, i know this probably is not the best place to ask this but here goes: Where do you recommend for me to start with using jgroups, i have read the book, and executed the simple chat example, but need more in depth example of using stuff in jgroups, like how to detect that a client(node) is down, are there code examples somewhere?

  3. Yes, this is not the best place :-)
    A better place would be the users mailing list [1].
    We also offer training: [2] has a 1.5 day section on JGroups.


  4. Anonymous3:00 PM

    ITSolusenz departments manage all components of software development including, Application Development Company, software development company india, Software Development Services.