I have no experience on load balancing softwares and I am a little lost in the documentation and research. What I am looking for is if there is an API for mode_cluster balancer or some programmatic way to remove a configured node or add a new node without having to restart the Apache server.
-
The back end servers are Tomcat. – Panagiotis Stoupos Oct 19 '15 at 06:32
-
I cannot use the default ping/pong way that mod_cluster uses to indentify the nodes. – Panagiotis Stoupos Oct 20 '15 at 13:36
-
I found these commands that can be passed as parameters through mod_cluster_manager's URL: [link](https://developer.jboss.org/wiki/Mod-ClusterManagementProtocol). I cannot figure out and make the CONFIG command work and I cannot find any proper example using this. – Panagiotis Stoupos Oct 20 '15 at 13:39
1 Answers
Answer
As a matter of fact, here are your examples With the obvious exception of the jboss-cli one, since you are using Tomcat. The mod_cluster manager console one and the telnet one is valid though.
CONFIG
message example in particular, for instance:
{ echo "CONFIG / HTTP/1.1"; echo "Host: rhel7GAx86-64:8847"; echo "Content-Length: 115"; echo "User-Agent: Test"; echo ""; echo -e "JVMRoute=worker1&Host=192.168.1.1&Maxattempts=1&Port=8080&StickySessionForce=No&Type=ajp&ping=10&Aliases=default\c"; sleep 1;} | telnet rhel7GAx86-64:8847
Where rhel7GAx86-64:8847
is your MCMP enabled VirtualHost in Apache HTTP Server and 192.168.1.1:8080
is your worker node.
After the CONFIG
message, STATUS
messages are expected, e.g.:
{ echo "STATUS / HTTP/1.1"; echo "Host: rhel7GAx86-64:8847"; echo "Content-length: 26"; echo ""; echo -e "JVMRoute=worker1&Load=100/c"; sleep 1; sleep 1; } | telnet rhel7GAx86-64 8847
ENABLE-APP messages follows, if you wish to configure contexts.
Further elaboration
And now, please, do explain why you need it? This statement is erroneous:
I cannot use the default ping/pong way that mod_cluster uses to identify the nodes. – DonCorleone Oct 20 at 13:36
Cping/Cpong logic is used only with AJP protocol in order to check the fitness of registered worker nodes before a request is forwarded to them. It hos nothing to do with worker nodes registering themselves with the Apache HTTP Server load balancer.
Apache HTTP Server advertises its presence via UDP multicast messages. Your Tomcat worker nodes then register themselves and their application contexts with Apache HTTP Server. AS you startup/shutdown your Tomcats or as you deploy/undeploy applications, Apache HTTP Server authomaticaly updates its list ow workers and their deployed applications, so the load balancer always knows whereto it should forward new requests.
Unless you are writing some kind of test suite, I cannot fathom what your use case could be. Thanks for sharing your thoughts.
Cheers

- 414
- 6
- 24
-
Thank you for your answer. My servers are not proper Tomcat servers. They are Endeca MDEX instances and they can not ping pong or be configured as a Tomcat using the mod_cluster listener in server.xml. Actually this was mostly a research on how mod_cluster works to see if can be used and I was working with Tomcat servers to run some tests. – Panagiotis Stoupos Nov 04 '15 at 07:04
-
I see. Well, without the mod_cluster listener on the worker side - i.e. without mod_cluster logic on Endeca MDEX instances, it doesn't make much sense to use mod_cluster as a load balancer. Although the benefit of having completely dynamic, application lifecycle aware balancer is so great that it might be worth it for you to implement the logic on the Endeca MDEX side. Take a look at [Catalina integration](https://github.com/modcluster/mod_cluster/tree/master/container). – Michal Karm Babacek Nov 04 '15 at 09:06
-
Indeed dynamic node registration is the feature that would nicelly fit in this kind of system. Thank you for your answers. – Panagiotis Stoupos Nov 04 '15 at 09:16