2 Replies Latest reply on Mar 2, 2010 9:37 AM by Martin Dixon

    mod_cluster not registering all host aliases

    Martin Dixon Newbie

      I'm running with a fairly minimal configuration of mod_cluster 1.0.3.GA with apache 2.2.13 and jboss AS 5.1. I have been testing with one apache/mod_cluster instance running on one server, and 2 other servers both running jboss with exactly the same applications deployed. Each application has a virtual host and 2 alias entries. The applications share the same context root, but use different virtual hosts and aliases.

       

      The problem I see is that the first jboss instance to register with mod_cluster has all its applications and aliases for the virtual hosts recognised correctly, but the 2nd jboss instance to register with mod_cluster (running exactly same apps) is missing a vhost alias or two. Can anyone provide help with why this might be happening?

       

      Here is the configuration and relevant log output:

       

      Apache instance httpd.conf -

       

      Listen zzz.zzz.zzz.zzz:6666
      <VirtualHost zzz.zzz.zzz.zzz:6666>
         <Directory />
            Order deny,allow
            Deny from all
            Allow from xxx.xxx.
         </Directory>
      KeepAliveTimeout 60
      MaxKeepAliveRequests 0
      ManagerBalancerName c-balancer
      AdvertiseFrequency 5
      </VirtualHost>

       

      JBoss instance jbossweb server.xml -

       

      <Server>
         ...
         <Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener"
                  delegateBeanName="ModClusterService"/>
         ...
         <Service name="jboss.web">
         ...
            <Engine name="jboss.web" defaultHost="localhost" jvmRoute="node-c-1">
               <Host name="application1.domain.co.uk">
                  <Alias>application1-alias1.domain.co.uk</Alias>
                  <Alias>application1-alias2.domain.co.uk</Alias>
                  <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
                      cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
                      transactionManagerObjectName="jboss:service=TransactionManager" ></Valve>
               </Host>
               <Host name="application2.domain.co.uk">
                  <Alias>application2-alias1.domain.co.uk</Alias>
                  <Alias>application2-alias2.domain.co.uk</Alias>
                  <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
                      cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
                      transactionManagerObjectName="jboss:service=TransactionManager" ></Valve>
               </Host>
            </Engine>
         </Service>
      </Server>

       

      The second jboss instance is configured as above, except with jvmRoute="node-c-2"

       

      When I start apache, and then bring up the jboss instances one by one, the first one registers fine with all applications (contexts, virtual hosts and aliases), but the second jboss instance registers with some missing aliases. Output of mod_cluster_manager:

       

      Node node-c-1 (ajp://xxx.xxx.xxx.xxx:8009):
      Enable Contexts Disable Contexts
      Balancer: mycluster,Domain: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 1,Ttl: 60000000,Elected: 359,Read: 1193376,Transferred: 89,Connected: 3,Load: 88,Num sessions: 0
      Virtual Host 1:
      Contexts:

       

      /unified-invoker, Status: ENABLED Disable
      /contextroot, Status: ENABLED Disable

       

      Aliases:

       

      localhost
      application1.domain.co.uk
      application2.domain.co.uk
      application1-alias1.domain.co.uk
      application1-alias2.domain.co.uk
      application2-alias1.domain.co.uk
      application2-alias2.domain.co.uk

       


      Node node-c-2 (ajp://xxx.xxx.yyy.yyy:8009):
      Enable Contexts Disable Contexts
      Balancer: mycluster,Domain: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 1,Ttl: 60000000,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100,Num sessions: 0
      Virtual Host 1:
      Contexts:

       

      /unified-invoker, Status: ENABLED Disable
      /contextroot, Status: ENABLED Disable

       

      Aliases:

       

      localhost
      application1.domain.co.uk
      application2.domain.co.uk
      application2-alias1.domain.co.uk
      application2-alias2.domain.co.uk

       

      SessionIDs:

       

      So mod_cluster_manager shows node-c-2 is missing the 2 Alias entries for application1, but they appear fine for application2...

       

      From a clean start of apache and jboss instances, as the first jboss instance comes up debug output of apache error_log is:

       

      [Fri Feb 26 12:32:43 2010] [debug] mod_manager.c(1929): manager_handler ENABLE-APP (/) processing: "JVMRoute=node-c-1&Alias=application1.domain.co.uk,application1-alias1.domain,application1-alias2.domain&Context=%2fcontextroot"
      [Fri Feb 26 12:32:43 2010] [debug] mod_manager.c(1970): manager_handler ENABLE-APP  OK
      [Fri Feb 26 12:32:44 2010] [debug] mod_manager.c(1416): manager_trans ENABLE-APP (/)                                                                          
      [Fri Feb 26 12:32:44 2010] [debug] mod_manager.c(1929): manager_handler ENABLE-APP (/) processing: "JVMRoute=node-c-1&Alias=application2.domain.co.uk,application2-alias1.domain,application2-alias2.domain&Context=%2fcontextroot"
      [Fri Feb 26 12:32:45 2010] [debug] mod_manager.c(1970): manager_handler ENABLE-APP  OK
      [Fri Feb 26 12:32:50 2010] [debug] mod_manager.c(1416): manager_trans STATUS (/)
      [Fri Feb 26 12:32:50 2010] [debug] mod_manager.c(1929): manager_handler STATUS (/) processing: "JVMRoute=node-c-1&Load=100"
      [Fri Feb 26 12:32:50 2010] [debug] proxy_util.c(1999): proxy: ajp: has acquired connection for (xxx.xxx.xxx.xxx)
      [Fri Feb 26 12:32:50 2010] [debug] proxy_util.c(2055): proxy: connecting ajp://xxx.xxx.xxx.xxx:8009/ to xxx.xxx.xxx.xxx:8009
      [Fri Feb 26 12:32:50 2010] [debug] proxy_util.c(2153): proxy: connected ajp://xxx.xxx.xxx.xxx:8009/ to xxx.xxx.xxx.xxx:8009
      [Fri Feb 26 12:32:50 2010] [debug] proxy_util.c(2308): proxy: ajp: fam 2 socket created to connect to xxx.xxx.xxx.xxx
      [Fri Feb 26 12:32:50 2010] [debug] mod_proxy_cluster.c(1194): ajp_cping_cpong: Done
      [Fri Feb 26 12:32:50 2010] [debug] proxy_util.c(2017): proxy: ajp: has released connection for (xxx.xxx.xxx.xxx)
      [Fri Feb 26 12:32:50 2010] [debug] mod_manager.c(1970): manager_handler STATUS  OK
      [Fri Feb 26 12:33:00 2010] [debug] mod_manager.c(1416): manager_trans STATUS (/)

       

      mod_cluster_manager shows node-c-1 with all contexts, vhosts and aliases registered as expected at this stage...

       

      As the second jboss instance is brought up the debug output of apache error_log is:

       

      [Fri Feb 26 12:47:58 2010] [debug] mod_manager.c(1929): manager_handler STATUS (/) processing: "JVMRoute=node-c-2&Load=100"
      [Fri Feb 26 12:47:58 2010] [debug] proxy_util.c(1999): proxy: ajp: has acquired connection for (xxx.xxx.yyy.yyy)
      [Fri Feb 26 12:47:58 2010] [debug] proxy_util.c(2055): proxy: connecting ajp://xxx.xxx.yyy.yyy:8009/ to xxx.xxx.yyy.yyy:8009
      [Fri Feb 26 12:47:58 2010] [debug] proxy_util.c(2153): proxy: connected ajp://xxx.xxx.yyy.yyy:8009/ to xxx.xxx.yyy.yyy:8009
      [Fri Feb 26 12:47:58 2010] [debug] proxy_util.c(2308): proxy: ajp: fam 2 socket created to connect to xxx.xxx.yyy.yyy
      [Fri Feb 26 12:48:01 2010] [debug] mod_manager.c(1416): manager_trans STATUS (/)
      [Fri Feb 26 12:48:01 2010] [debug] mod_manager.c(1929): manager_handler STATUS (/) processing: "JVMRoute=node-c-1&Load=89"
      [Fri Feb 26 12:48:01 2010] [debug] proxy_util.c(1999): proxy: ajp: has acquired connection for (xxx.xxx.xxx.xxx)
      [Fri Feb 26 12:48:01 2010] [debug] proxy_util.c(2055): proxy: connecting ajp://xxx.xxx.xxx.xxx:8009/ to xxx.xxx.xxx.xxx:8009
      [Fri Feb 26 12:48:01 2010] [debug] proxy_util.c(2153): proxy: connected ajp://xxx.xxx.xxx.xxx:8009/ to xxx.xxx.xxx.xxx:8009
      [Fri Feb 26 12:48:01 2010] [debug] mod_proxy_cluster.c(1194): ajp_cping_cpong: Done
      [Fri Feb 26 12:48:01 2010] [debug] proxy_util.c(2017): proxy: ajp: has released connection for (xxx.xxx.xxx.xxx)
      [Fri Feb 26 12:48:01 2010] [debug] mod_manager.c(1970): manager_handler STATUS  OK
      [Fri Feb 26 12:48:08 2010] [error] ajp_cping_cpong: apr_socket_recv failed
      [Fri Feb 26 12:48:08 2010] [debug] mod_proxy_cluster.c(1194): ajp_cping_cpong: Done
      [Fri Feb 26 12:48:08 2010] [debug] proxy_util.c(2017): proxy: ajp: has released connection for (xxx.xxx.yyy.yyy)
      [Fri Feb 26 12:48:08 2010] [debug] mod_manager.c(1970): manager_handler STATUS  OK
      [Fri Feb 26 12:48:08 2010] [debug] mod_manager.c(1416): manager_trans ENABLE-APP (/)
      [Fri Feb 26 12:48:08 2010] [debug] mod_manager.c(1929): manager_handler ENABLE-APP (/) processing:
      "JVMRoute=node-c-2&Alias=application1.domain.co.uk,application1-alias1.domain,application1-alias2.domain&Context=%2fcontextroot"
      [Fri Feb 26 12:48:09 2010] [debug] mod_manager.c(1970): manager_handler ENABLE-APP  OK
      [Fri Feb 26 12:48:10 2010] [debug] mod_manager.c(1416): manager_trans ENABLE-APP (/)
      [Fri Feb 26 12:48:10 2010] [debug] mod_manager.c(1929): manager_handler ENABLE-APP (/) processing:
      "JVMRoute=node-c-2&Alias=application2.domain.co.uk,application2-alias1.domain,application2-alias2.domain&Context=%2fcontextroot"
      [Fri Feb 26 12:48:10 2010] [debug] mod_manager.c(1627): manager_handler ENABLE-APP error: MEM: Can't read host alias

       

      and at the same time this is appearing in the second jboss instance server.log:


      ERROR [org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Error [MEM: MEM: Can't read host alias: {4}] sending command ENABLE-APP to proxy zzz.zzz.zzz.zzz:80, configuration will be reset
      ERROR [org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Error [MEM: MEM: Can't read host alias: {4}] sending command ENABLE-APP to proxy zzz.zzz.zzz.zzz:80, configuration will be reset

       

      At this time mod_cluster_manager shows node-c-2 missing the 2 Aliases for application1 as above.

       

      jbossweb.sar/server.xml and app vhost configuration is exactly the same on both jboss instances...

       

      Thank you in advance for any help with this...