0
votes

I'm going to explain my situation.

Background:

I'm running three virtual machines with Debian Jessie on Open Nebula, one as master and the other two as slaves. In them i've installed JBoss AS 7.1 and mod_cluster 1.2.

Goal:

Run a stateful app, so when I shutdown the master server the cluster allows me to continue using the app with shared session and mantain the variables values.

I followed this guide with the given web application.

Errors:

  • I can't access directly the app at http://master/cluster-demo/ like as in the guide above, I have to specify the port (8330 for server-three).
  • When I shutdown server-three the slaves notices that the server is shutted down but the session is not shared and the application is no more accessible. This is the output on slave when i shoutdown server-three on master.

Configuration Files

I attach my configuration files:

1

1 Answers

0
votes

Answer

mod_cluster does not have anything in common with messaging (JMS, HornetQ) subsystems. mod_cluster setting also does not have anything in common with clustering subsystem, i.e. Infinispan and its workhorse, JGroups.

What AS7 mod_cluster subsystem does is that is listens to UDP multicast advertising messages emitted by Apache HTTP Server mod_cluster modules. When it receives such message, it registers itself with your Apache HTTP Server load balancer. From that moment, your registered AS7 "worker" node keeps sending specialized HTTP messages (via TCP), informing Apache HTTP Server about:

  • its name (jvmRoute or generated)
  • its current load
  • its deployments, i.e. application contexts
  • aliases etc.

When there are no worker nodes registered with your Apache HTTP Server balancer, there are no contexts, hence there is nowhere to forward your requests to.

According to the configuration you posted, you rely on UDP multicast messages being sent to/received from 224.0.1.105:23364.

Open Nebula, firewall and UDP multicast

It is possible that Open Nebula doesn't allow UDP multicast between hosts or that your iptables are blocking it. Try this:

  • use curl on your worker host to access the balancer host -- exactly the VirtualHost where you have the directive EnableMCPMReceive defined.
  • if it doesn't work, you must fix iptables, selinux, httpd's allow/deny and such
  • if it works, it's a good sign that worker can talk to the balancer
  • go to your AS7 xml, modcluster subsystem, and add attribute to the config: <mod-cluster-config advertise-socket="modcluster" proxy-list="your-httpd-address:port"> -- the one you've just tried with curl
  • now it should work even without UDP multicast
  • if you would like to debug your UDP multicast settings in Open Nebula, give it a shot with Advertize.java

1.2.0 is too old, do not use vulnerable code

Please, do not use mod_cluster 1.2.0 with your Apache HTTP Server. The version is completely obsolete and it contains serious bugs, including a code injection CVE and severe performance issue. Download mod_cluster 1.3.1.Final for httpd 2.4.x or build your own from the sources, if you desire httpd 2.2.x support. If you happen to need any any help with that, ask.