Help me understand Balancers and multiple EAP clusters
ehle Aug 8, 2013 6:38 PMHello,
I've read through the docs, but I'm still not sure I grok how balancers work in relation to EAP6/AS7(WF7?) clusters, and EAP mod_cluster groups - especially when you have multiple ones.
We have been very successful with "simple" environment of 2 web front end servers, behind a hardware load balancer, supporting several JBoss instances.
Apache mod_cluster config looks like this (on both systems):
mod_cluster.conf:
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule advertise_module modules/mod_advertise.so
MemManagerFile /var/cache/mod_cluster
# Start ModCluster/Jboss Config
<IfModule manager_module>
Listen 6666
<VirtualHost *:6666>
ServerName jboss-www-alpha.my.domain:6666
ServerAlias *:6666
<Directory />
Order deny,allow
#Deny from all
#Allow from all
Allow from 192.168.1.0/24
Allow from 127.0.0.1
</Directory>
EnableMCPMReceive On
ManagerBalancerName alpha_cluster
AdvertiseGroup 224.0.2.10:23364
AdvertiseFrequency 5
ServerAdvertise On
KeepAliveTimeout 60
MaxKeepAliveRequests 0
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
AllowDisplay on
Deny from all
# Allow from all
Allow from 192.168.1.0/24
</Location>
</VirtualHost>
</IfModule>
# End ModCluster/Jboss Config
And a virtual host entry that contains:
ProxyPass / balancer://alpha_cluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://alpha_cluster
JBoss Config:
<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
<mod-cluster-config advertise-socket="modcluster" proxy-list="192.198.1.20:6666,192.198.1.25:6666" proxy-url="/" balancer="alpha_cluster" advertise="true" connector="ajp">
<dynamic-load-provider>
<load-metric type="busyness"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
That all works
The jboss stuff all identifies itself as alpha_cluster in its eap and mod_cluster cluster config info.
However I was trying to figure out, what we would need to do if we add another eap cluster? Especially if we wanted to do rolling deployment, or otherwise be able to stop new connections going to all members of the cluster at once.
I thought we would need to create a different mod_cluster grouping for the second beta_cluster:
<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
<mod-cluster-config advertise-socket="modcluster" proxy-list="192.198.1.20:6666,192.198.1.25:6666" proxy-url="/" balancer="beta_cluster" advertise="true" connector="ajp">
<dynamic-load-provider>
<load-metric type="busyness"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
and if we do that, the mod_cluster_manager page does see the second Balancer and lists it.
But at that point I'm kind of lost...
Will we need another set of ProxyPass entries (as below) or does mod_cluster create the extra balancers based on the fact that there are EAP clusters telling it that they are needed?
ProxyPass / balancer://beta_cluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://beta_cluster
Will we need to make changes to your mod_cluster.conf?
I could be wrong, but it it seemed that the 2 mod_cluster systems were not forming a "domain" and I did not see the option to disable all the alpha_cluster system contexts in the mod_cluster_manager page - is there something else we need for that?
If we have a second balancer listed in the same virtual host entry... will there be context conflicts?
What is alpha_cluster has myapp version 0.2 at /foo/myapp and beta_cluster has myapp version 1.3 at /foo/myapp ?
What happens if alpha_cluster has alpha_app at /foo/alpha_app and beta_cluster has beta_app at /foo/beta_app?
beta_cluster ONLY has /foo/beta_app and alpha ONLY hass /foo/alpha_app as requests come in for http://mysite.com/foo/alpha_app and http://mysite.com/foo/beta_app, the apache server/mod_cluster will do the sorting of which server to send the request to automagically correct?
Sorry if these are really basic questions... I just wasn't having much luck with seeing full multi-balancer examples (though this is pretty close http://httpd.apache.org/docs/2.2/mod/mod_proxy.html ) and wanted to see if I could get a better understanding.
Thanks in advance!
David.