[jboss-as7-dev] Problem met on as7 clustering with mod_cluster

Weinan Li weli at redhat.com
Tue Jan 17 23:53:16 EST 2012


Hi,

	I've tried to play AS7 with clustering mode and seems failed on last step. Here's what I did:

	1. Prepare two hosts: one is 'master' (10.0.2.3), the other one is 'slave' (10.0.2.2)
	2. 'master' is domain controller
	3. deploy a 'hello-world' web app into domain. The project is extremely simple: just a index.jsp and web.xml. In web.xml there is  a <distributable/>.
	4. The contents in index.jsp:

	<% System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date(); %> 
	
	5. Start two hosts, the domain seems run correctly, and the web-app is deployed correctly in domain. From log from both 'master' and 'slave', they are all fine:

	slave log: [Server:server-three-slave] 12:25:18,673 INFO  [stdout] (MSC service thread 1-2) GMS: address=server-three-slave/web, cluster=web, physical address=10.0.2.2:55450

	master log: [Server:server-three] 12:25:12,885 INFO  [stdout] (MSC service thread 1-1) GMS: address=server-three/web, cluster=web, physical address=10.0.2.3:55450


	6. Start apache httpd with mod_cluster setup, and seeing from the log everything is fine:

	httpd log: [Wed Jan 18 12:13:25 2012] [notice] Digest: done
[Wed Jan 18 12:13:25 2012] [notice] Advertise initialized for process 11716
[Wed Jan 18 12:13:25 2012] [notice] Apache/2.2.15 (Unix) DAV/2 mod_cluster/1.1.x configured -- resuming normal operations

	master log: [Server:server-three] 12:25:21,339 INFO  [org.jboss.modcluster.ModClusterService] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Engine [jboss.web] will use jvmRoute: b5c2598e-49fb-3c4b-996c-f3451747f44a

	7. the httpd is run on 10.0.2.3
	8. try to access cluster from http://10.0.2.3/demo, it redirects me to: http://10.0.2.3:8330/demo, and I could see the 'hello world' projects page. Seems everything is fine, domain works, cluster works, and web project in jboss domain can be accessed correctly via mod_cluster. BUT here is the problem:

	There's some communication problem between mod_cluster on 'master' (10.0.2.3) and the host on 'slave' (10.0.2.2), if the jboss host on 'slave' is run and registered into domain controller, mod_cluster begins to throw error:
	
	% tail -f /etc/httpd/logs/error_log 

	[Wed Jan 18 01:21:59 2012] [error] (111)Connection refused: proxy: http: attempt to connect to 127.0.0.1:8330 (localhost) failed
[Wed Jan 18 01:21:59 2012] [error] ap_proxy_connect_backend disabling worker for (localhost)
[Wed Jan 18 01:22:00 2012] [error] proxy: http: disabled connection for (localhost)

	So the result becomes that only 'master' is serving the request from http://10.0.2.3/demo

	This could be seen when we access the index.jsp in demo project, because in jsp we have:

		<% System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date(); %> 

	We can only see the log output in 'master':

	[Server:server-three] 12:15:33,041 INFO  [stdout] (http--10.0.2.3-9138-1) Evaluating date now

	And I've tried to use multiple web browsers / different computers to access the cluster, all I can see is that only 'master' is serving the requests, 'slave' is idle all the time.	

	I'm using jboss-as-7.1.0.CR1b in my environment (there are bugs in previous version in infinispan/as7 integration on clustering). And I'm using  mod_cluster-1.1.3.Final-linux2-x86-so.tar.gz for httpd part.

	And here's my mod_cluster conf:

	Listen 10.0.2.3:6666

<VirtualHost 10.0.2.3:6666>

  <Directory />
    Order deny,allow
    Deny from all
    Allow from 10.0.2.
  </Directory>

  KeepAliveTimeout 60
  MaxKeepAliveRequests 0

  ManagerBalancerName other-server-group
  AdvertiseFrequency 5

</VirtualHost>

	I can ensure that domain are set correctly. So I believe the problem should be in mod_cluster/as7 integration part. But I cannot find what I'm doing wrong on my configurations, can anyone help?

	

Cheers,
- Weinan Li
JBoss, Redhat









More information about the jboss-as7-dev mailing list