Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache + mod_cluster + wildfly on Ubuntu

I'm trying to get the following setup working:

apache 2.4 + mod_cluster 1.3 Final + ubuntu 14.04.2-server + Wildfly 8.1.0 Final

and I'm successfully advertising the wildfly context to apache, but when I try to hit the load balancer I get a 500.

Also, when I restart apache after I've started wildfly, I get the following error:

MODCLUSTER000042: Error MEM sending STATUS command to 192.168.56.101/192.168.56.101:10001, configuration will be reset: MEM: Can't read node

Here are my configs:

mod_cluster.conf

<IfModule manager_module>
   Listen *:10001
   ManagerBalancerName modcluster
   ProxyPass /cluster-demo balancer://modcluster stickysession=JSESSIONID|jsessionid nofailover=On
   ProxyPassReverse /cluster-demo balancer://modcluster
   ProxyPreserveHost On

<VirtualHost *:10001>

  <Location />
    Require all granted
  </Location>

  KeepAliveTimeout 60
  MaxKeepAliveRequests 0
  EnableMCPMReceive On
  AdvertiseFrequency 5
  ServerAdvertise On http://192.168.56.101:10001
  AdvertiseGroup 224.0.1.105:23364

  <Location /mod_cluster-manager>
   SetHandler mod_cluster-manager
   Require all granted
  </Location>

 </VirtualHost>

 <VirtualHost *:80>
   <Location />
     Require all granted
   </Location>
 </VirtualHost>

</IfModule>

mod_cluster.load

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.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

domain.xml

    ...
    ...
    <subsystem xmlns="urn:jboss:domain:modcluster:1.2">
                    <mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.56.101:10001" \
    balancer="modcluster" excluded-contexts="invoker,jbossws,juddi,console" load-balancing-group="other-\
    server-group" connector="ajp">
                        <dynamic-load-provider>
                            <load-metric type="busyness"/>
                        </dynamic-load-provider>
                    </mod-cluster-config>
                </subsystem>
    ...
    ...
    <subsystem xmlns="urn:jboss:domain:modcluster:1.2">
                    <mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.56.101:10001" \
    balancer="modcluster" excluded-contexts="invoker,jbossws,juddi,console" load-balancing-group="other-\
    server-group" connector="ajp">
                        <dynamic-load-provider>
                            <load-metric type="busyness"/>
                        </dynamic-load-provider>
                    </mod-cluster-config>
                </subsystem>

Not sure what I'm doing wrong, any help would be appreciated. Thanks.

like image 487
PTBG Avatar asked Apr 15 '15 15:04

PTBG


1 Answers

First of all try with Wildfly 8.2 instead of 8.1 :-)

Mod_cluster.load content should be this:

  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_module /usr/lib/apache2/modules/mod_proxy_ajp.so 
  LoadModule cluster_slotmem_module /usr/lib/apache2/modules/mod_cluster_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

the slotmem in mod_cluster 1.3 has been renamed to "mod_cluster_slotmem". And the ajp proxy module was missing in your file.

Starting apache you will get the following in console:

 [Fri May 08 12:31:02.213753 2015] [so:warn] [pid 7989:tid 140491011782528] AH01574: module proxy_module is already loaded, skipping
 [Fri May 08 12:31:02.213882 2015] [so:warn] [pid 7989:tid 140491011782528] AH01574: module proxy_http_module is already loaded, skipping

However you need to keept the proxy_module and proxy_http_module in the mod_cluster.load file.

like image 65
Laura Liparulo Avatar answered Sep 29 '22 23:09

Laura Liparulo