-
30. Re: Clustering begginner..please HELP
davewebb Feb 15, 2007 10:21 AM (in response to sreejava)Try this:
# Define list of workers that will be used # for mapping requests # The configuration directives are valid # for the mod_jk version 1.2.18 and later # Define Node1 # modify the host as your host IP or DNS name. worker.node1.port=8009 worker.node1.host=node1._._._.209 worker.node1.type=ajp13 worker.node1.lbfactor=1 # worker.node1.connection_pool_size=10 (1) # Define Node2 # modify the host as your host IP or DNS name. worker.node2.port=8009 worker.node2.host= node2._._._.124 worker.node2.type=ajp13 worker.node2.lbfactor=1 # worker.node1.connection_pool_size=10 (1) # Load-balancing behaviour worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=node1, node2 worker.loadbalancer.sticky_session=1 worker.loadbalancer.local_worker_only=1 worker.list=loadbalancer
And for worker.node1.host dont use node1 or node2, just put the IP address of the machine like this (but using your own subnet)worker.node1.host=192.168.1.209 worker.node2.host= 192.168.1.124
Remove thisHowever i have added the following lines of code with uriworkermap.properties as per hmesha's posting
Code:
# Test App
/TestApp=loadbalancer
/TestApp/*=loadbalancer
The JkMount in the apache VirtualHost directive takes care of this. -
31. Re: Clustering begginner..please HELP
hmesha Feb 15, 2007 10:23 AM (in response to sreejava)Here's your problem
worker.node1.host=node1._._._.209
this line should only have the host ip address or name and not node1._._._.209 Remove node1 and node2 from the your workers.properties file. The way it's right now the host ip address is invalid and apache won't be able to resolve it.
You're very close, don't give up :)
cheers -
32. Re: Clustering begginner..please HELP
sreejava Feb 15, 2007 10:40 AM (in response to sreejava)boss...
i removed the lines from uriworkermap.properties
and corrected the workers.properties file asworker.node1.host=_._._.209
Now when i tried http://localhost/TestApp/ i got
ModJK should not allow me to see this once configured properly
======================================
In some other material i read that, there should be a tag in the web.xml of the WEB-INF in the war file.
By the way, in one of the previous posting i was directed to putJkMount /YourApp/* loadbalancer
inside the<VIRTUALHOST> </VIRTUALHOST>
and also thatThe String "/YourApp/*" needs to match the ContextRoot setup in the web.xml file of your WAR.
And I have done this by addingcontext-path="/TestApp"
as an attribute-value pair in the<web-app><web-app>
like<web-app context-path="/TestApp"><web-app>
It is correct. Right? -
33. Re: Clustering begginner..please HELP
davewebb Feb 15, 2007 10:45 AM (in response to sreejava)You need this in your web.xml. Refer to the DTD for the correct order.
<!-- Indicated the app is coded for a clustered environment --> <distributable/>
Your JkMount point shoud match the WAR Module Deployment Descriptor in your EAR's application.xml file.<module> <web> <web-uri>TestApp.war</web-uri> <context-root>/TestApp</context-root> </web> </module>
-
34. Re: Clustering begginner..please HELP
sreejava Feb 15, 2007 11:48 AM (in response to sreejava)i ve to create the application.xml inside WEB-INF folder.right?
And its full content is as you suggested (i mean these code is not nested within any other tag, Right)<module> <web> <web-uri>TestApp.war</web-uri> <context-root>/TestApp</context-root> </web> </module>
-
35. Re: Clustering begginner..please HELP
sreejava Feb 16, 2007 6:28 AM (in response to sreejava)sorry for asking "where the application.xml has to be created".
I got it from various websites...
Let me explain my directory structure.
Mine was a sample application with the following directory structure which properly served from JBoss server (that is when i make a request for http:// localhost:8080/TestApp/ )
Previous Directory Structure (WAR)TestApp.war | /venkatesh.jsp | /showname.jsp | /db.jsp | /MET-INF | /Manifest.mf | /WEB-INF | /web.xml
But Now, i have changed the directory structure in order to include the application.xml and made it TestApp.EAR as follows,
This is also properly served from JBoss server. So i think i have included the application.xml correctly.
Current Directory structure (EAR)TestApp.ear | |----/META-INF/application.xml | |----/TestApp.war | /venkatesh.jsp | /showname.jsp | /db.jsp | /MET-INF | /Manifest.mf | /WEB-INF | /web.xml
Hope, it is correct.
BUT Painfully.
...
....
....i failed Again!!!!!, even with the following (suggested) modifications...
1. Modified workers.properties as per the suggestion.
2. Removed the unnecessary modification in uriworkermap.properties file
3. included application.xml with the following content
<?xml version="1.0" encoding="UTF-8"?> <application> <module> <web> <web-uri>TestApp.war</web-uri> <context-root>/TestApp</context-root> </web> </module> </application>
4.included the disributable tag in web.xmlas follows<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" context-path="/TestApp"> <distributable/> <welcome-file-list> <welcome-file> venkatesh.jsp </welcome-file> </welcome-file-list> </web-app>
still the page-index.html which is inside htdocs/TestApp/ folder appeears when i try http://TestApp;
Kindly help...
with regards
sree -
36. Re: Clustering begginner..please HELP
sreejava Feb 16, 2007 7:01 AM (in response to sreejava)If possible kindly verify the steps i have done for achiving Load Balencing....( and FAILED.........)
Inside Apache2
1.Apache2.2\conf\httpd.conf (modified)
2.Apache2.2\modules\mod_jk.so (downloaded)
3.Apache2.2\conf\mod_jk.conf (created)
4.Apache2.2\conf\workers.properties (created)
Inside JBoss of Both the nodes
5.JBOSS\..\node1\deploy\jbossweb-tomcat55.sar\server.xml (modified)
6.JBOSS\..\node1\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml (modified)
Inside sample application
7.TestApp.EAR\...\application.xml
8.TestApp.WAR\...\.web.xml
Should i post the contents of the files i have added or modified inorder to find the error? -
37. Re: Clustering begginner..please HELP
sreejava Feb 16, 2007 7:52 AM (in response to sreejava)
THANK YOU BOSS.................
I SUCCEEDED IN MY ATTEMPT ..
EVEN THE SESSION DETAILS GOT TRANSFERRED BETWEEN SERVERS....
THANKS A LOT..
THANK YOU
THANK YOU
THANK YOU -
38. Re: Clustering begginner..please HELP
davewebb Feb 16, 2007 2:59 PM (in response to sreejava)Sree,
You were able to accomplish in a few days what took me and others several weeks. You are very welcome. Please support the open source forums by becoming more familiar with the clustering process. Then, monitor this group and help others. I'm glad you have everything working and I think you are going to be really happy with Jboss as your app server solution.
Good job! -
39. Re: Clustering begginner..please HELP
sreejava Feb 17, 2007 12:39 AM (in response to sreejava)
Hi David Webb and Hany Mesha,
Special thanks to both of you?
I think it became possible because I was in an advantageous position to beggin with the timely help, guidance and support from broad minded people like you. I feel really proud to be part of this open source forum and definitely I will remain an active member.
Thanks to all members of the forum
Thanks and Regards
Sree. -
40. Re: Clustering begginner..please HELP
jjay009 Feb 18, 2007 4:59 PM (in response to sreejava)Hi Dave Webb
Can you please refer to the solution you posted under the following link.
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016787#4016787
I removed the commons-digester.jar file from the EAR file. Now I am getting following error.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR [ActionServlet] Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as
unavailable. Most likely, this is due to an incorrect or missing library dependency.
java.lang.NoClassDefFoundError: org/apache/commons/chain/config/ConfigParser
at org.apache.struts.action.ActionServlet.initChain(ActionServlet.java:1625)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:347)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Do you have any idea why i am experiencing this error? and how to fix it?
Thank you -
41. Re: Clustering begginner..please HELP
davewebb Feb 18, 2007 5:42 PM (in response to sreejava)What is your environment? JDK/JRE, JBoss, OS?
-
42. Re: Clustering begginner..please HELP
jjay009 Feb 18, 2007 5:51 PM (in response to sreejava)JDK 1.5, JBoss 4.0.5 and WindowsXP
Thanks