load balancing in mod_cluster does not seem to work properly with 3 nodes - node 3 is never elected
claudianus Nov 8, 2012 6:30 PMHello -
I am seeing some behavior that does not seem right to me with mod_cluster and I was wondering if this is how it is supposed to work.
I am running three EAP 6 nodes fronted by apache 2 on a ubuntu 12.04 OS. Each of the servers (jboss and apache) has its own ip (virtual or physical). I am running mod_cluster 1.2 and EAP 6 for each of the jboss nodes. I am starting them with standalone-ha.xml
I have configured apache to use various settings.
Conf 1
CreateBalancers 1
<IfModule manager_module>
Listen 192.168.10.25:9000
<VirtualHost 192.168.10.25:9000>
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost On
<Directory />
Order deny,allow
Deny from all
Allow from 192.168.10.
</Directory>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 192.168.10.
</Location>
ManagerBalancerName mycluster
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise On
EnableMCPMReceive
</VirtualHost>
</IfModule>
Then I configured it like below
Conf 2
CreateBalancers 2
<IfModule manager_module>
Listen 192.168.10.25:9000
<VirtualHost 192.168.10.25:9000>
#ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On
#ProxyPassReverse / balancer://mycluster
#ProxyPreserveHost On
<Directory />
Order deny,allow
Deny from all
Allow from 192.168.10.
</Directory>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 192.168.10.
</Location>
ManagerBalancerName mycluster
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise On
EnableMCPMReceive
</VirtualHost>
</IfModule>
Both configurations work.
My AS7 config for mod_cluster looks like below for each of the nodes:
conf 1
<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
<mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.10.25:9000" proxy-url="/" advertise="true" excluded-contexts="ROOT,invoker,jbossws,juddi,console" auto-enable-contexts="true" stop-context-timeout="10" socket-timeout="20" sticky-session="true" sticky-session-remove="false" sticky-session-force="false" worker-timeout="-1" max-attempts="1" flush-packets="false" flush-wait="-1" ping="10" smax="-1" ttl="-1" node-timeout="-1" connector="ajp">
<simple-load-provider />
</mod-cluster-config>
</subsystem>
conf 2
<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
<mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.10.25:9000" proxy-url="/" advertise="true" excluded-contexts="ROOT,invoker,jbossws,juddi,console" auto-enable-contexts="true" stop-context-timeout="10" socket-timeout="20" sticky-session="true" sticky-session-remove="false" sticky-session-force="false" worker-timeout="-1" max-attempts="1" flush-packets="false" flush-wait="-1" ping="10" smax="-1" ttl="-1" node-timeout="-1" connector="ajp">
<dynamic-load-provider history="0" decay="2">
<load-metric type="busyness"/>
<load-metric type="sessions" weight="2" capacity="512"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
I have tried various configurations and can never get apache to elect node 3.
It always elect node 1 an then node 2 but almost never node 3.
The only time I saw it elect node 3 was when I had two different web apps deployed and have been hitting the first one which was routed to node 1 or node 2 and then I tried to hit the second app and at that point node 3 was elected and that was the only time I ever saw it elected.
It this how it is supposed to work?
Why wouldn't it elect node 3? I tried various combination of dynamic load balancing policies and also the simple load provider to no avail.
Has anyone else seeing this? What am I missing?
Thanks,
C