Questions tagged [mod-cluster]

Mod_cluster is a dynamically configured load balancer implemented for Apache HTTP Server, Undertow and Nginx. It has worker-side libraries for all Tomcat 6+, JBoss AS 5+ and Wildfly servers. It is a JBoss community project.

Mod_cluster uses a communication channel to forward requests from balancer to worker nodes and another channel to receive load and application lifecycle events from worker nodes.

Balancer

Mod_cluster load balancing logic is implemented in a set of Apache HTTP Server modules, in a suite of modules for Nginx and last but not least, as a part of Undertow web server; usable both as Undertow standalone and as a Wildfly server. All these projects are striving to maintain protocol compatibility.

Worker

Mod_cluster, unlike other proxies such as mod_proxy or mod_jk, uses worker-side libraries that tap into servlet containers life cycles. These libraries are implemented for Tomcat 6+, JBoss AS 5+ and Wildfly. One could have a Wildfly balancer with Wildfly workers, Apache HTTP Server balancer with Wildfly or Tomcat workers etc.

Communication channel

Mod_cluster workers are either configured with Mod_cluster balancer address or they listen to UDP multicast advertising of Mod_cluster balancer where they learn the address and port of Mod_cluster balancer.

Worker nodes proceed on registering themselves with the balancer by sending custom HTTP methods messages, telling the balancer where to contact them, i.e. worker's addresses and ports, and most importantly, which web application contexts they have deployed. Workers periodically send information about their current load or lifecycle events, e.g. re-deployment, shutting down etc.

Balancer sends client's requests to worker nodes and processes replies. It only addresses a worker node if the worker node responds to a special "ping" on application layer. It means that it is not enough for the balancer that the TCP connection to worker is open, it actively ascertains that the worker is really processing requests.

From balancer to workers

Mod_cluster balancer offers these protocols for sending requests to worker nodes: AJP, HTTP, HTTPS, WS/WSS (Apache HTTP Server and Undertow implementations), HTTP/2 (Undertow implementation).

From workers to balancer

Mod_cluster management messages use either HTTP, HTTPS or HTTP/2.

Why mod_cluster

Mod_cluster provides quite a few distinct advantages over mod_jk or mod_proxy:

  • Improved load balancing between worker nodes since the load metric is calculated directly by the worker node instead of the load balancer
  • Mod_cluster is aware of the lifecyle of applications in the application server so it knows when an application gets deployed or undeployed
  • It supports all mainstream protocols - AJP, HTTP, HTTPS, WS/WSS, HTTP/2, unlike mod_jk which only supports AJP
  • It uses advertisement of balancers location so workers could find it without any static configuration. It makes it very easy especially in a cloud environment to automatically add or remove nodes based on the load factor

More information can be found on the mod_cluster community page http://modcluster.io.

10 questions
1
vote
2 answers

Not able to start apache in Wildfly 10 domain mode cluster with Apache mod_cluster, due to SELinux issue

I am trying to setup a Wildfly 10 cluster in domain mode with Apache mod_cluster. In my Centos 7 webserver node I have installed Apache(2.4.6) using: # yum install httpd Then copied the following .so files to the /etc/httpd/modules…
abhishek
  • 11
  • 2
1
vote
1 answer

Load balancing using Httpd mod_cluster and tomcat not working

I am trying to setup a load balancer using Httpd, mod_cluster and Tomcat. My Httpd is running on the same server with IP 192.168.9.73 where the tomcat is running. Here is my Httpd configuration- Listen *:9999
code13
  • 173
  • 3
  • 9
1
vote
2 answers

Securing SSL requests with mod_cluster?

In case I have both the httpd and JBoss in secure LAN, is it possible to terminate SSL requests at httpd, and pass the request to available JBoss via mod_cluster? Any idea what configuration involved?
SyRenity
  • 3,159
  • 11
  • 55
  • 79
0
votes
2 answers

WildFly 17 load balance with mod_cluster without apache in domain mode

I've successfully created a WildFly cluster with 3 hosts in domain mode. Now I'm trying to get the mod_cluster subsystem without apache or other server in the middle, as I've seen it's possible, but I haven't found any recent documentation to…
0
votes
1 answer

Sticky sessions are not maintained in Mod_cluster load balancer for JBoss EAP 7

I am certifying my application on JBoss EAP 7. My application works on standalone mode but in cluster mode, my application gets deployed but I am unable to login. I am again re-routed to login url. I have setup cluster using mod_cluster. There is no…
0
votes
0 answers

Apache mod_cluster 1.2.6 and jboss 6: All workers are in error state for only one jboss web-application

One of my Jboss web-applications under the URL "/api/hornet-q" always returns 503. I'm hosting multiple web-applications in Jboss and I'm clustering it through Apache and mod_cluster. For now the Apache node and Jboss cluster node are on the same…
0
votes
1 answer

Disabling nonce check in Apache mod_cluster

I am trying to write a shell script on my Apache server with mod_cluster to enable and disable contexts. However, it is not working because of the nonce. How do I disable the check for this? Googling shows that there is a CheckNonce option but does…
user1207177
  • 133
  • 1
  • 7
0
votes
1 answer

Apache and JBoss mod_cluster speed up reload

As an alternative to this question, is it possible to decrease the amount of time that it takes for the Apache (httpd) server to pick up the JBoss servers after the Apache server reloads? As of right now, it is taking between 10 and 20 seconds; I…
user1207177
  • 133
  • 1
  • 7
0
votes
3 answers

mod_cluster reports "MEM: Can't read node" and "All workers are in error state" for JBoss AS 7.1.1 cluster

I am trying to configure a JBoss AS 7.1.1 cluster in domain mode with mod_cluster at the apache2 proxy. All hosts are running Ubuntu and are Rackspace Cloud Servers. My problem is that when I hit my app at http://project.example.com/ I just get a…
Simon Gibbs
  • 61
  • 1
  • 11
0
votes
1 answer

Load balancing using mod_cluster with httpd and Tomcat only?

Is it possible to design a load balancer using Apache Httpd with mod_cluster and Tomcat only (No JBossAS or JBossWeb)?
code13
  • 173
  • 3
  • 9