Version 3

    Intro


    This document describes a proposed solution for JGRP-1322, the mod cluster discovery protocol which would allow JGroups nodes to discover each other in a httpd + JBoss AS setup. JGroups nodes would use httpd proxy as a point of reference for discovery as httpd already knows the list of JGroups/AS participating nodes and provides this information in a well known format!

     

    Background

    Before proceeding forward, a reader might start with a general mod cluster documentation overview, followed by mod cluster design details, finishing with details of MCMP protocol.

     

     

    Proposed solution

     

    Similar to other JGroups discovery protocols the communication roundtrip consists of a single discovery message sent from a joining JGroups cluster node to a cluster member node that will respond with a response consisting of addresses of existing cluster members.

    The MCMP can be easly extented with 3 new messages:

     

    ADDID:

    The ADDID MCMP will create or update an existing JGroups record in mod_cluster, like the CONFIG is doing it for a node.

    The request will look like the following:

    +++

    ADDID / HTTP/1.1
    Host: myhttpd

    Content-length: 128 (well the right value)

     

    JGroupUuid=jgroupuuid&JGroupData=jgroupdata

    +++

    The max size of jgroupuuid is 80 and the max size of jgroupdata is 200. The data is base64 encoded.

     

    REMOVEID:

    The REMOVEID MCMP will remove an existing JGroups record in mod_cluster, like the REMOVE * is doing it for a node.

    The request will look like the following:

    +++

    REMOVE / HTTP/1.1
    Host: myhttpd

    Content-length: 128 (well the right value)

     

    JGroupUuid=jgroupuuid

    +++

     

    QUERY:

    The QUERY MCMP will query existing JGroups records according the parameter JGroupUuid. The answer uses the same format of the INFO_RSP MCMP element. Something like the following:

    +++

    QUERY / HTTP/1.1
    Host: myhttpd

    Content-length: 128 (well the right value)

     

    JGroupUuid=jgroupuuid

    +++

    jgroupuuid = * means all jgroup existing nodes.

     

    The answer will be something like:

    +++

    HTTP/1.1 200 OK

    Date: Wed, 25 Jan 2012 12:44:54 GMT

    Server: Apache/2.2.21 (Unix) DAV/2 mod_jk/1.2.30 mod_ssl/2.2.21 OpenSSL/0.9.8r mod_cluster/1.1.x

    Content-Length: 558

    Content-Type: text/plain

     

    JGroup: [9],JGroupUuid: node4, JGroupData: jgroupdata4

    JGroup: [11],JGroupUuid: node6, JGroupData: jgroupdata6

    +++