1 Reply Latest reply on Jun 4, 2012 6:33 AM by rjanapala

    Mod_Cluster in JBoss As 7.1

    rjanapala

      Hi,

       

      I have configured mod_cluster with httpd, to run the JBoss in cluster mode. For this I have followed the document AS7+Cluster+Howto.

       

      Please find those details below.

       

      After successfully configuring  two(Master & Salve) JBoss servers in my machine, I deployed the test application Cluster-Demo.war file on Master using management console. The application is deplyed succesfully and showing result for the following URL  http://192.168.0.16:8330/Cluster-Demo.

      Hello World!

        Hello!  The time is now Sat Jun 02 19:33:47 IST 2012

       

       

       

      Later I have configured httpd 2.2 + Mod_cluster1.2 to load balance the requests.

       

      Below are the configuration that I have made in httpd.conf

       

      Copied mod_slotmem.so, mod_manager.so, mod_proxy_cluster.so, mod_advertise.so files into modules folder.

      Un-commented mod_proxy_ajp.so, mod_proxy.so files.

       

      Below are the configuration that I have made in httpd.conf files

       

      LoadModule slotmem_module modules/mod_slotmem.so

      LoadModule manager_module modules/mod_manager.so

      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

      LoadModule advertise_module modules/mod_advertise.so

       

      Listen 192.168.0.16:6666

      <VirtualHost 192.168.0.16:6666>

       

        <Directory />

          Order deny,allow

          Deny from all

          Allow from 192.168.0.

        </Directory>

       

       

        # This directive allows you to view mod_cluster status at URL http://192.168.0.16:6666/mod_cluster-manager

        <Location /mod_cluster-manager>

         SetHandler mod_cluster-manager

         Order deny,allow

         Deny from all

         Allow from 192.168.0.

        </Location>

       

        KeepAliveTimeout 60

        MaxKeepAliveRequests 0

       

        ManagerBalancerName other-server-group

        AdvertiseFrequency 5

       

      </VirtualHost>

       

      Later I have restarted the httpd server, to reflect the changes. when I tested with http://192.168.0.16 for apache and http://192.168.0.16:6666/mod_cluster-manager for mod_clueter they are working.

       

      Now when I provide the http://192.168.0.16/Cluster-Demo/get.jsp to test the application it is saying The requested URL /Cluster-Demo/get.jsp was not found on this server.

       

      Could any one help me to relove this.

        • 1. Re: Mod_Cluster in JBoss As 7.1
          rjanapala

          Hi,

           

          After adding EnableMCPMReceive" in the Apache httpd.conf file virtualhost, I have overcome the above issue. But now I am facing a new problem.

           

          The Mod_Cluster is working perfectly fine when the Master node is running.

           

          When I start the slave node and access the application http://192.168.0.16/Cluster-Demo it is saying The requested URL /Cluster-Demo/ was not found on this server.

           

          Below are the configuration details of Master and Slave nodes.

           

          FYI:  I am running both Master and Slave in same machine by changing the ports

           

          ###################Master host.xml############################

          To avoid prot conflicts I have chnaged the management ports in Master

              <management-interfaces>

                      <native-interface security-realm="ManagementRealm">

                          <socket interface="management" port="${jboss.management.native.port:10199}"/>

                      </native-interface>

                      <http-interface security-realm="ManagementRealm">

                          <socket interface="management" port="${jboss.management.http.port:10190}"/>

                      </http-interface>

                  </management-interfaces>

           

          <interfaces>

                  <interface name="management">

                      <inet-address value="${jboss.bind.address.management:192.168.0.16}"/>

                  </interface>

                  <interface name="public">

                     <inet-address value="${jboss.bind.address:192.168.0.16}"/>

                  </interface>

                  <interface name="unsecure">

                      <!-- Used for IIOP sockets in the standarad configuration.

                           To secure JacORB you need to setup SSL -->

                      <inet-address value="192.168.0.16"/>

                  </interface>

              </interfaces>

           

             <server name="server-one" group="main-server-group" auto-start="false">

                      <!-- Remote JPDA debugging for a specific server

                      <jvm name="default">

                        <jvm-options>

                          <option value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>

                        </jvm-options>

                     </jvm>

                     -->

                  </server>

                  <server name="server-two" group="main-server-group" auto-start="false">

                      <!-- server-two avoids port conflicts by incrementing the ports in

                           the default socket-group declared in the server-group -->

                      <socket-bindings port-offset="150"/>

                  </server>

                  <server name="server-three" group="other-server-group" auto-start="true">

                      <!-- server-three avoids port conflicts by incrementing the ports in

                           the default socket-group declared in the server-group -->

                      <socket-bindings port-offset="250"/>

                  </server>

          ####################################################################

           

           

          #########################Slave host.xml##############################

           

          <security-realm name="ManagementRealm">

                       <server-identities>

                         <secret value="NDU2NDU2"/>

                       </server-identities>

                          <authentication>

                              <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>

                          </authentication>

                      </security-realm>

           

          <domain-controller>

                 <!--<local/>-->

                 <!-- Alternative remote domain controller configuration with a host and port -->

                 <!-- <remote host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}"/> -->

                 <remote host="192.168.0.16" port="10199" security-realm="ManagementRealm"/>

              </domain-controller>

           

           

              <interfaces>

                  <interface name="management">

                      <inet-address value="${jboss.bind.address.management:192.168.0.16}"/>

                  </interface>

                  <interface name="public">

                     <inet-address value="${jboss.bind.address:192.168.0.16}"/>

                  </interface>

                  <interface name="unsecure">

                      <!-- Used for IIOP sockets in the standarad configuration.

                           To secure JacORB you need to setup SSL -->

                      <inet-address value="192.168.0.16"/>

                  </interface>

              </interfaces>

           

          <servers>

                  <server name="server-one" group="main-server-group" auto-start="false">

                      <!-- Remote JPDA debugging for a specific server

                      <jvm name="default">

                        <jvm-options>

                          <option value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>

                        </jvm-options>

                     </jvm>

                     -->

                     <socket-bindings port-offset="500"/>

                  </server>

                  <server name="server-two" group="main-server-group" auto-start="false">

                      <!-- server-two avoids port conflicts by incrementing the ports in

                           the default socket-group declared in the server-group -->

                      <socket-bindings port-offset="750"/>

                  </server>

                  <server name="server-three-slave" group="other-server-group" auto-start="true">

                      <!-- server-three avoids port conflicts by incrementing the ports in

                           the default socket-group declared in the server-group -->

                      <socket-bindings port-offset="650"/>

                  </server>

              </servers>

          ################################################################################

           

           

           

          ####################httpd.conf######################################

          Listen 192.168.0.16:6666

          <VirtualHost 192.168.0.16:6666>

          EnableMCPMReceive

            <Directory />

              Order deny,allow

              Deny from all

              Allow from 192.168.0.

            </Directory>

           

           

            # This directive allows you to view mod_cluster status at URL http://192.168.0.16:6666/mod_cluster-manager

            <Location /mod_cluster-manager>

             SetHandler mod_cluster-manager

             Order deny,allow

             Deny from all

             Allow from 192.168.0.

            </Location>

            AdvertiseGroup 224.0.1.105:23364

            AdvertiseFrequency 10

            KeepAliveTimeout 60

            MaxKeepAliveRequests 0

            ServerAdvertise On

            ManagerBalancerName other-server-group

            #AdvertiseFrequency 5

           

          </VirtualHost>

           

           

          LoadModule slotmem_module modules/mod_slotmem.so

          LoadModule manager_module modules/mod_manager.so

          LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

          LoadModule advertise_module modules/mod_advertise.so

          LoadModule proxy_module modules/mod_proxy.so

          LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

          LoadModule proxy_http_module modules/mod_proxy_http.so

           

          Copied /mod_slotmem.so, /mod_manager.so, mod_proxy_cluster.so, mod_advertise.so into Apache modules folder.

          #######################################################################

           

          After all the above coonfiguration I am able to start Master and slave sucessfully without any Error's. And I in Master log it also showing JBAS010918: Registered remote slave host "slave", JBoss EAP 6.0.0.Beta1 (AS 7.1.0.Final-redhat-1).

           

          But When I access the application http://192.168.0.16/Cluster-Demo in cluster mode It is not working. Howerver if I shutdown the slave instance and try to access the application with same URL it is working.

           

          Could any one help me to solve this.