Ubuntu上的apache + mod_cluster + wildfly

时间:2015-04-15 15:30:05

标签: apache ubuntu jboss wildfly-8 mod-cluster

我试图让以下设置正常工作:

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

并且我成功地将wildfly上下文广告给了apache,但是当我尝试点击负载均衡器时,我得到了500.

另外,当我在启动wildfly之后重启apache时,我收到以下错误:

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

以下是我的配置:

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>

不确定我做错了什么,任何帮助都会受到赞赏。感谢。

1 个答案:

答案 0 :(得分:1)

首先尝试使用Wildfly 8.2而不是8.1: - )

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_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

mod_cluster 1.3中的slotmem已重命名为&#34; mod_cluster_slotmem&#34;。 并且文件中缺少ajp代理模块。

启动apache,您将在控制台中获得以下内容:

 [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

但是你需要保存mod_cluster.load文件中的proxy_module和proxy_http_module。