- What is Advertise
- What to do if I don’t want to use Advertise (UDP multicast)
- It is not working, what should I do?
- I started mod_cluster and it looks like it’s using only one of the workers
- Keep seeing “HTTP/1.1 501 Method Not Implemented”
- Redirect is not working (Tomcat, JBossWeb):
- I have more than one Tomcat/JBossWeb Connector
- Chrome does not display /mod_cluster_manager page
- Using mod_cluster and SELinux.
- System properties to modify behaviour
This site is work in progress 2017-10-23: Please, refer to http://mod-cluster.jboss.org/ until the content here is complete.
What is Advertise
Advertise allows autodiscovery of httpd proxies by the cluster nodes. It is done by sending multicast messages from httpd to the cluster. The httpd specialized module: mod_advertise sends UDP message on a multicast group, both mod_advertise and the cluster listener joined the multicast group and the cluster receives the messages.
Example of a mod_advertise message:
The X-Manager-Address header value is used by the cluster logic to send information about the cluster to the proxy. It is the IP and port of the VirtualHost where mod_advertise is configured or URL parameter of the ServerAdvertise directive.
What to do if I don’t want to use Advertise (UDP multicast)
In the VirtualHost receiving the MCPM of httpd.conf don’t use any Advertise directive or set explicitly:
On the worker side, add the addresses and ports of the VirtualHost receiving MCMP (having
EnableMCPMReceive) to the
property and set advertise to false, for example:
JBoss AS 5
Tomcat 6/7/8 and JBossWeb
It is not working, what should I do?
Please, at first, go through the following check-list. Set Apache HTTP Server’s
LogLevel debug in
error_log. If you get stuck, you are welcome to
There is no error in the error_log
That happens when Advertise is not working and no Proxy List is configured: The worker nodes do not get the from Apache HTTP Server.
TODO: Links to docs; explain terms.
- Check that the modules are loaded and Advertise is started. In httpd.conf activate extended information display, add:
When accessing the mod_cluster_manager console you should get something like: TODO: Image. If not, go to the Minimal Example and add the missing directive(s).
- Check that Advertise message are received on the cluster node. A small Java utility could be used to check Advertise. It is in the mod_cluster repository and can be compiled using javac. The output should be something like:
If there are no Advertise messages, check the firewall. Advertise uses UDP port 23364 and multicast address 22.214.171.124 by default. Furthermore, do not bind to localhost/127.0.0.1, use a non-localhost IP address for your balancer — workers UDP advertisement test.
If you are unable to get the Advertisement to work, try it first without it, with a static configuration without UDP multicast.
Error in server.log or catalina.out
IO error sending command: Check the firewall and error_log, if there is nothing in the error_log then it is a firewall problem. If you have something like:
it means that the worker was unable to contact the balancer. Keep in mind that the communication is bidirectional.
You can use telnet hostname/address port to check that it is OK, e.g.:
Check that the address and port are the expected ones you may use ServerAdvertise directive in you mod_cluster httpd configuration:
Error in error_log
client denied by server configuration: The directory in the VirtualHost is not allowed for the client. If you have something like:
You need to have something like the undermentioned authentication configured in the ```EnableMCPMReceive``` marked VirtualHost:
I started mod_cluster and it looks like it’s using only one of the workers
One must give the system some time, in matter of the amount of new sessions created, to settle and pick other nodes. An example from an actual environment: You have 3 nodes with the following Load values:
Node jboss-6, Load: 20 Node jboss-6-2, Load: 90 Node jboss-6-3, Load: 1
Yes, this means that jboss-6-2 is almost not loaded at all whereas jboss-6-3 is desperately overloaded. Now, I send 1001 requests, each representing a new session (the client is forgetting cookies). The distribution of the requests will be as follows:
Node jboss-6 served 181 requests Node jboss-6-2 served 811 requests Node jboss-6-3 served 9 requests
So, generally, yes, the least loaded box received by far the greatest amount of requests, but it did not receive them all. Furthermore, and this concerns your case, for some time from the start, it was jboss-6 who was getting requests.
This whole magic is in place in order to prevent congestion.
Keep seeing “HTTP/1.1 501 Method Not Implemented”
Redirect is not working (Tomcat, JBossWeb):
When using http/https instead of AJP, proxyname, proxyhost and redirect must be configured in the Tomcat Connector. Something like:
I have more than one Tomcat/JBossWeb Connector
mod_cluster tries to use the first AJP connector configured. If there
is not any AJP connector, it uses the http or https that has the biggest
maxthreads value. That is
maxThreads in Tomcat 6/7/8 and JBoss AS 5/6:
max-connections in JBoss AS7: (32 * processor + 1 for native and 512 * processor + 1 for JIO).
In Web subsystem:
Chrome does not display /mod_cluster_manager page
When using Chrome with mod_cluster_manager, the page is not displayed and the following error is displayed instead:
you can change the port of the VirtualHost to 7777 or any value chrome accepts or add:
to the start parameters of Chrome.
Using mod_cluster and SELinux.
mod_cluster needs to open port and create shared memory and files, therefore some permissions have to be added, you need to configure something like:
Put the above in a file for example mod_cluster.te and generate the mod_cluster.pp file (for example in Fedora 16):
The mod_cluster.pp file should be proceeded by semodule as root:
Alternatively, one may use semanage and add ports and paths labels manually.
System properties to modify behaviour
org.jboss.modcluster.container.catalina.status-frequency — (default: 1)
makes worker to send STATUS MCMP messages only 1/n periodic event.
The events occur every
backgroundProcessorDelay (default 10 seconds).