I'm trying to get the following setup working:
OS: Ubuntu 14.04.3 LTS Apache2: Apache/2.4.7 (Ubuntu) mod_cluster 1.3.1 wildfly: wildfly-10.0.0.CR2 domain mode (server-one in main-server-group and server-two in other-server-group on same ubuntu server) test deployment: cluster-demo
After 2 weeks I have apache with mod_cluster working, but wildfly doesn't work as expected.
My apache config:
sites-enabled/wildfly.conf
Listen 80
<VirtualHost *:80>
ServerAdmin info@domain.de
ServerName myserver.com
ServerAlias www.myserver.com
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from All
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ProxyPass / ajp://host:8009/
ProxyPassReverse / ajp://host:8009/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
mods-enabled/mod_cluster.conf
CreateBalancers 1
<IfModule manager_module>
Listen host:10001
ManagerBalancerName myclustern
<VirtualHost host:10001>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise On http://host:10001
EnableMCPMReceive
AdvertiseGroup 224.0.1.105:23364
<Location />
Order deny,allow
Deny from all
Allow from all
Require all granted
</Location>
<Location /mod_cluster-manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from all
</Location>
</VirtualHost>
</IfModule>
mods-enabled/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 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-manager is available, the demo page from cluster-demo is also available. But the apache error log shows following errors:
[Mon Oct 19 21:18:34.798472 2015] [proxy:error] [pid 30588:tid 139836923037440] (111)Connection refused: AH00957: ajp: attempt to connect to host:27233 (host) failed
[Mon Oct 19 21:18:34.798523 2015] [proxy:error] [pid 30588:tid 139836923037440] AH00959: ap_proxy_connect_backend disabling worker for (host) for 60s
[Mon Oct 19 21:18:44.799481 2015] [proxy:error] [pid 30588:tid 139836902057728] AH00940: ajp: disabled connection for (host)
[Mon Oct 19 21:18:54.800456 2015] [proxy:error] [pid 30588:tid 139836881078016] AH00940: ajp: disabled connection for (host)
[Mon Oct 19 21:19:04.801415 2015] [proxy:error] [pid 30588:tid 139836870588160] AH00940: ajp: disabled connection for (host)
[Mon Oct 19 21:19:14.802499 2015] [proxy:error] [pid 30589:tid 139836755199744] AH00940: ajp: disabled connection for (host)
[Mon Oct 19 21:19:24.803463 2015] [proxy:error] [pid 30589:tid 139836744709888] AH00940: ajp: disabled connection for (host)
[Mon Oct 19 21:19:34.804541 2015] [proxy:error] [pid 30588:tid 139836849608448] (111)Connection refused: AH00957: ajp: attempt to connect to host:27233 (host) failed
[Mon Oct 19 21:19:34.804602 2015] [proxy:error] [pid 30588:tid 139836849608448] AH00959: ap_proxy_connect_backend disabling worker for (host) for 60s
[Mon Oct 19 21:19:44.805589 2015] [proxy:error] [pid 30589:tid 139837055608576] AH00940: ajp: disabled connection for (host)
[Mon Oct 19 21:19:54.806578 2015] [proxy:error] [pid 30589:tid 139837045118720] AH00940: ajp: disabled connection for (host)
When I stop server-one from main-server-group server-two said,
(Incoming-2,ee,master:server-two) ISPN000094: Received new cluster view for channel web: [master:server-two|12] (1) [master:server-two]
but in the browser I get instead of the cluster-demo page:
Service unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
My wildfly domain.xml config is the standard config from the server aside from these two chanches:
<socket-binding-groups>
<socket-binding-group name="full-ha-sockets" default-interface="public">
...
<outbound-socket-binding name="mc-prox1">
<remote-destination host="host" port="10001"/>
</outbound-socket-binding>
</socket-binding-group>
</socket-binding-groups>
and
<subsystem xmlns="urn:jboss:domain:modcluster:2.0">
<mod-cluster-config advertise-socket="modcluster" proxies="mc-prox1" sticky-session="true" sticky-session-remove="false" sticky-session-force="false" connector="ajp">
<dynamic-load-provider>
<load-metric type="cpu"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
Is for apache the 000-default.conf necessary? If I remove the proxypass and proxypassreverse annotation I can’t reach the demo page. Why I need the proxies annotation in wildfly to get the apache running? Is there something wrong with advertise module?
Hope somone can help me.