1 2 3 Previous Next 30 Replies Latest reply on Nov 21, 2013 3:36 AM by dabraham81

    JBoss AS 7 Clustering and httpd virtualhost

    hfluz

      I'm following this guide to setup my JBoss AS 7 Cluster: https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto

       

      I already configured my JBoss AS in domain mode and I'm able to access my application deployed in several nodes in two hosts through the web browser.

       

      I have no experience with httpd and my problem is with its mod_cluster configuration.

       

      I installed CentOS linux in a virtualbox machine and added the mod_cluster modules to /etc/httpd/modules, then I added the LoadModule lines to httpd.conf.

       

      My problem is in the following step. JBoss AS Domain is in the 189.90.70.58 host, while httpd is intalled in the 10.0.2.15. In the tutorial both are on the same host, then I don't know which IP to use in virtualhost configuration.

       

       

      Listen 10.211.55.7:10001
      MemManagerFile /var/cache/httpd
      
      <VirtualHost 10.211.55.7:10001>
        <Directory />
          Order deny,allow
          Deny from all
          Allow from 10.211.55.
        </Directory>
      
      
        # This directive allows you to view mod_cluster status at URL http://10.211.55.4:10001/mod_cluster-manager
        <Location /mod_cluster-manager>
         SetHandler mod_cluster-manager
         Order deny,allow
         Deny from all
         Allow from 10.211.55.
        </Location>
      
        KeepAliveTimeout 60
        MaxKeepAliveRequests 0
      
        ManagerBalancerName other-server-group
        AdvertiseFrequency 5
      </VirtualHost>
      

       

      Another doubt. Do I need to configure JBoss AS to communicate with httpd through 10001 port?

        • 1. Re: JBoss AS 7 Clustering and httpd virtualhost
          hfluz

          I guess that's a simple configuration question, could somebody help me?

           

          If my message is not clear enough (english is not my native language) I can try to explain better.

          • 2. Re: JBoss AS 7 Clustering and httpd virtualhost
            kazaag

            In the virtual host you should put the IP of the proxy (the httpd node).

             

            But you need to put the network of the JBoss's node in the allow from as the JBoss nodes need to connect to this virtual host to register them self.

             

            If multicasting is routed between your httpd node to JBoss node (in your configuration if you didn't make it avalble it is probably not working) default configuration will work.

             

            The other option is to provide the proxy list in the JBoss mod cluster configuration.

            1 of 1 people found this helpful
            • 3. Re: JBoss AS 7 Clustering and httpd virtualhost
              hfluz

              I tried with 2 hosts but I got some errors. Now I'm trying to configure both (JBoss AS 7 in domain mode and httpd) in the same host.

               

              My OS is Ubuntu (IP 189.90.70.58) and I configured mod_cluster this way (https://gist.github.com/1543449):

               

              mod_cluster.load

              LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
              LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
              LoadModule proxy_ajp_module /usr/lib/apache2/modules/mod_proxy_ajp.so
              LoadModule slotmem_module /usr/lib/apache2/modules/mod_slotmem.so
              LoadModule manager_module /usr/lib/apache2/modules/mod_manager.so
              LoadModule proxy_cluster_module /usr/lib/apache2/modules/mod_proxy_cluster.so
              LoadModule advertise_module /usr/lib/apache2/modules/mod_advertise.so

               

              mod_cluster.conf

              CreateBalancers 1
              
              <IfModule manager_module>
                  Listen 189.90.70.58:6666
                  ManagerBalancerName mycluster
              
                  <VirtualHost 189.90.70.58:6666> 
                      KeepAliveTimeout 300
                      MaxKeepAliveRequests 0
                      AdvertiseFrequency 5
                      ServerAdvertise On
              
                      <Location />
                          Order deny,allow
                          Allow from 189.90.70
                      </Location>
              
                   </VirtualHost>
              
              </IfModule>
              

               

              Then I added a location recommended by AS Cluster Howto (https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto):

              <Location /mod_cluster-manager>
                 SetHandler mod_cluster-manager
                 Order deny,allow
                 Deny from all
                 Allow from 189.90.70.
              </Location>
              

               

              Then I enabled mod_cluster:

              a2enmod mod_cluster

               

              Then I reloaded and restarted apache:

              service apache2 reload
              service apache2 restart
              

               

              I got no errors until here. But when I try to access 189.90.70.58/my-app-name or 189.90.70.58:6666/mod_cluster_manager my web browser cannot find anything. Why is that happening? I missed some step?

              • 4. Re: JBoss AS 7 Clustering and httpd virtualhost
                hfluz

                An update:

                 

                I found the missing step. I forgot to create de symbolic link for mod_cluster log:

                #ln -s /var/log/apache2 /etc/apache2/logs

                Now I'm able to acess mod_cluster_manager page, but JBoss AS is not registered there. What could be the problem?

                • 5. Re: JBoss AS 7 Clustering and httpd virtualhost
                  hfluz

                  I added "AllowDispay on" in mod_cluster configuration. Now when I acess 189.90.70.58:8888/mod_cluster-manager the following info is displayed:

                   

                  mod_cluster/1.1.x
                  start of "httpd.conf" configuration
                  mod_proxy_cluster.c: OK
                  mod_sharedmem.c: OK
                  Protocol supported: http AJP 
                  mod_advertise.c: OK
                  Server: localhost 
                  Server: localhost VirtualHost: *:80
                  Server: u217.ati.uel.br VirtualHost: 189.90.70.58:8888 Advertising on Group 224.0.1.105 Port 23364 for http://189.90.70.58:8888 every 5 seconds
                  end of "httpd.conf" configuration
                  

                   

                  It seems to me that JBoss AS 7 is not responding, but mod_cluster socket-binding is using the same adress and port:

                   

                  <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
                  
                  • 6. Re: JBoss AS 7 Clustering and httpd virtualhost
                    rmody

                    Hi Humberto,

                     

                    Can you try adding the "proxy-list" having your Apache server ip-address in the "mod-cluster-config" of your domain.xml file, something like below

                     

                     

                    <subsystem xmlns="urn:jboss:domain:modcluster:1.1">
                                    <mod-cluster-config advertise-socket="modcluster" connector="ajp" proxy-list="10.211.55.7:10001">
                    
                    • 7. Re: JBoss AS 7 Clustering and httpd virtualhost
                      hfluz

                      Ravish, I included proxy-list in mod-cluster-config:

                       

                      <subsystem xmlns="urn:jboss:domain:modcluster:1.0">
                          <mod-cluster-config advertise-socket="modcluster" proxy-list="189.90.70.58:8888">
                              <dynamic-load-provider>
                                  <load-metric type="busyness"/>
                              </dynamic-load-provider>
                          </mod-cluster-config>
                      </subsystem>
                      

                       

                      But with the same results, JBoss AS is not connecting to httpd through mod_cluster.

                       

                      P.s. I tried to add connector="ajp", but JBoss didn't accepted it.

                      • 8. Re: JBoss AS 7 Clustering and httpd virtualhost
                        hfluz

                        Using the Advertize.java mod_cluster tool:

                         

                        java Advertize 224.0.1.105 23364
                        
                        received from /189.90.70.58:23364
                        received: HTTP/1.0 200 OK
                        Date: Tue, 26 Jun 2012 13:14:45 GMT
                        Sequence: 558
                        Digest: 51f06c58078c63239f5df067731b0c35
                        Server: f8cf3eb0-0cfc-44a2-8d79-d43d190dbad4
                        X-Manager-Address: 189.90.70.58:8888
                        X-Manager-Url: /f8cf3eb0-0cfc-44a2-8d79-d43d190dbad4
                        X-Manager-Protocol: http
                        X-Manager-Host: u217.ati.uel.br
                        

                         

                         

                        Nothing appears in the mod_cluster-manager page, but I don't know if something should be displayed in this case.

                        • 9. Re: JBoss AS 7 Clustering and httpd virtualhost
                          rmody

                          It seems that you have added IP-Address of JBoss server in proxy-list instead of your httpd server as per your problem description

                           

                          Listen 10.211.55.7:10001
                          MemManagerFile /var/cache/httpd
                          
                          
                          <VirtualHost 10.211.55.7:10001>
                            <Directory />
                              Order deny,allow
                              Deny from all
                              Allow from 10.211.55.
                            </Directory>
                          

                           


                          Hence can you try correcting it and see if that helps you.

                          • 10. Re: JBoss AS 7 Clustering and httpd virtualhost
                            hfluz

                            Sorry, actually that was the configuration when I was using 2 hosts, now both JBoss AS and httpd are on the same host (189.90.70.58):

                             

                            My updated mod_cluster.conf

                            CreateBalancers 1
                            <IfModule manager_module>
                                Listen 189.90.70.58:8888
                                ManagerBalancerName mycluster
                                <VirtualHost 189.90.70.58:8888>
                                    KeepAliveTimeout 300
                                    MaxKeepAliveRequests 0
                                    AdvertiseFrequency 5
                                    ServerAdvertise On
                                    AdvertiseGroup 224.0.1.105:23364
                                    AllowDisplay On
                                    <Location />
                                        Order deny,allow
                                        Allow from all
                                    </Location>
                                    <Location /mod_cluster-manager>
                                        SetHandler mod_cluster-manager
                                        Order deny,allow
                                        Allow from all
                                    </Location>
                                 </VirtualHost>
                            </IfModule>
                            
                            • 11. Re: JBoss AS 7 Clustering and httpd virtualhost
                              hfluz

                              Comparing to JBoss AS 7 Configuration, Deployment and Administration book, using the cli :list-proxies command I should obtain the following result:

                               

                              [standalone@localhost:9999 subsystem=modcluster] :list-proxies
                              {
                                   "outcome" => "success",
                                   "result" => [
                                   "CP11-010:8888",
                                   "CP12-010:8888"
                              }
                              

                               

                              But instead of that I'm obtaining:

                               

                              [domain@189.90.70.58:9999 /] :list-proxies  
                              {
                                  "outcome" => "failed",
                                  "failure-description" => "JBAS010850: No handler for operation list-proxies at address []",
                                  "rolled-back" => true
                              }
                              
                              • 12. Re: JBoss AS 7 Clustering and httpd virtualhost
                                hfluz

                                It looks like I need to access the mod_cluster subsystem to execute the command :list-proxies. I tried "cd subsystem=modcluster", executed the command again, but I got the same output.

                                • 13. Re: JBoss AS 7 Clustering and httpd virtualhost
                                  kazaag

                                  Can you provide the modcluster related line from JBoss logs?

                                  • 14. Re: JBoss AS 7 Clustering and httpd virtualhost
                                    chandrashekar.bn

                                    Humberto, did you change configuration in {JBOSS_HOME}/domain/configuration/host.xml


                                    <interfaces>

                                           <interface name="management">

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

                                            </interface>

                                            <interface name="public">

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

                                            </interface>

                                        </interfaces>

                                    1 2 3 Previous Next