2 Replies Latest reply on Jul 11, 2014 2:25 AM by Alexis Hassler

    mod_cluster cannot find the node

    Alexis Hassler Apprentice

      Hi all,

       

      I'm using httpd 2.2.26 with WildFly 8.1 on the same MacOS X machine. I can bind my WildFly instance to the httpd with the :add-proxy CLI operation, but httpd+mod_cluster is not able to discover the instance.

       

      The WildFly instance is started on standalone mode, with the default standalone-ha.xml configuration. The modcluster subsystem configuration is :

       

        <subsystem xmlns="urn:jboss:domain:modcluster:1.2">
          <mod-cluster-config advertise-socket="modcluster" connector="ajp">
            <dynamic-load-provider>
              <load-metric type="cpu"/>
            </dynamic-load-provider>
          </mod-cluster-config>
        </subsystem>
      

      With the advertise socket binding :

       

              <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
      

      On the httpd side, the mod_cluster is configuration is :

       

      Listen 192.168.1.38:6666
      <VirtualHost 192.168.1.38:6666>
      
        <Location />
          Order deny,allow
          Deny from all
          Allow from 192.168.1
        </Location>
      
        KeepAliveTimeout 60
        MaxKeepAliveRequests 0
        
        ManagerBalancerName mycluster
        ServerAdvertise On
        AdvertiseFrequency 5  
        EnableMCPMReceive
        
      </VirtualHost>
      

      As suggested in the FAQ, I tried the Advertize test class which seems to work fine. Here is the answer :

       

      received from /192.168.1.38:23364
      received: HTTP/1.0 200 OK
      Date: Thu, 10 Jul 2014 22:23:58 GMT
      Sequence: 5
      Digest: f8965681c8e3665333ac5c4a836452ce
      Server: c95fbde6-91d6-4405-837d-b381933accc8
      X-Manager-Address: 192.168.1.38:6666
      X-Manager-Url: /c95fbde6-91d6-4405-837d-b381933accc8
      X-Manager-Protocol: http
      X-Manager-Host: mbpi7ha
      

      I also added "AllowDisplay On" in the httpd config, and now, the cluster-manager shows the followinf data :

       

      start of "httpd.conf" configuration
      mod_proxy_cluster.c: OK
      mod_sharedmem.c: OK
      Protocol supported: http AJP https
      mod_advertise.c: OK
      Server: 127.0.0.1 
      Server: mbpi7ha VirtualHost: 192.168.1.38:6666 Advertising on Group 224.0.1.105 Port 23364 for http://192.168.1.38:6666 every 5 seconds
      end of "httpd.conf" configuration
      

      And, of course, I don't see any error log, neither in httpd's error_log, nor in wildfly's server.log.

       

      What can be wrong in my config ? What could look at ?

       

      Alexis

        • 1. Re: mod_cluster cannot find the node
          Roman Jurkov Newbie

          Alexis,

           

          since it is on the same machine, you can't bind to the same socket, and that is probably because reuse of address is not set (SO_REUSEADDR). I don't know how to do that in jboss/java, however i looked briefly at mod_advertise, and i see that SO_REUSEADDR is set, so theoretically if you would start jboss first, let it bind to that socket, then start http, that should do the trick.

           

          -roman

          • 2. Re: Re: mod_cluster cannot find the node
            Alexis Hassler Apprentice

            Thanks for your help, Roman.

             

            I think that the Advertize test class is the proof that httpd / mod_cluster and a Java instance can share the same multicast socket.

             

            My problem was simplier and really dumb. I had to specify an IP binding to WildFly, for example :

             

            bin/standalone.sh -b 0.0.0.0 -c standalone-ha.xml
            
            

            Now mod_cluster and WildFly can discover each other.

             

            Alexis