[jboss-user] [Clustering/JBoss] - Jboss 4.2.1 web session problem

vkviswanadh do-not-reply at jboss.com
Thu Oct 25 13:08:15 EDT 2007


Hi All, 
     I configured my windows (xp) machine with 2 JBoss nodes (node1 and node2), by following the URL 

http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine

I created two nodes, node1 and node2. I copied all the folders from directory called "all" to both the nodes(node1 and node2).

Next I changed the <JBOSS_HOME>/all/conf/jboss-service.xml file.
Adding the nodes information under the attribute "Service Binding" as shown below.


  | <mbean code="org.jboss.services.binding.ServiceBindingManager"
  |      name="jboss.system:service=ServiceBindingManager">
  |      <attribute name="ServerName">ports-01</attribute>
  |      <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
  |      <attribute name="StoreFactoryClassName">
  |        org.jboss.services.binding.XMLServicesStoreFactory
  |      </attribute>
  |    </mbean>
  | 
  |    <mbean code="org.jboss.services.binding.ServiceBindingManager"
  |      name="jboss.system:service=ServiceBindingManager">
  |      <attribute name="ServerName">ports-02</attribute>
  |      <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
  |      <attribute name="StoreFactoryClassName">
  |        org.jboss.services.binding.XMLServicesStoreFactory
  |      </attribute>
  |    </mbean>
  | 

The sample-binding.xml file is having a example ports-01 and ports-02 information.

Next I changed the <JBOSS_HOME>/node1/conf/jboss-service.xml .
under the attribute "Service Binding" I added the below lines.

  | <mbean code="org.jboss.services.binding.ServiceBindingManager"
  |      name="jboss.system:service=ServiceBindingManager">
  |      <attribute name="ServerName">ports-02</attribute>
  |      <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
  |      <attribute name="StoreFactoryClassName">
  |        org.jboss.services.binding.XMLServicesStoreFactory
  |      </attribute>
  |    </mbean>
  | 

Same thing for node2 also, changed the "<JBOSS_HOME>/node1/conf/jboss-service.xml" file with above line ,ofcourse instead of node1 I changed it node2.

Apart from these changes I didn't done any thing.I started my node 1 as 


  | run.bat -b <IP ADDRESS OF MY MACHINE> -c node1
  | 

once it is started then I started the second node2 also.
with the same command as shown above with node2.

I observed that both are able to recognize. By seeing the below statements I confirmed that both are in cluster.


  | 11:07:16,343 INFO  [DefaultPartition] I am (166.35.136.77:1299) received membershipChanged event:
  | 11:07:16,343 INFO  [DefaultPartition] Dead members: 0 ([])
  | 11:07:16,343 INFO  [DefaultPartition] New Members : 1 ([166.35.136.77:1199])
  | 11:07:16,359 INFO  [DefaultPartition] All Members : 2 ([166.35.136.77:1299, 166.35.136.77:1199])
  | 11:07:16,921 INFO  [TreeCache] viewAccepted(): [166.35.136.77:2342|7] [166.35.136.77:2342, 166.35.136.77:3242]
  | 


I want to test whether my clustering environment is working fine or not.So I downloaded the Counter.war file ,and deployed it in "farm/node1" , once it is deployed , I was able to see the same war file in node2 farm/node2 also.

Next using the URL ,I am trying to access the index.jsp page.


  | http://IPADDRESS:8180/Counter/index.jsp
  | 

I am able to see the below out put.

  | session ID: 14A2E524B25759452569011337AAD950.node1
  | You have hit this page 2 times
  | 

I stopped the node1 JBoss instance.I haven't closed the browser and tested the same web page again,just pressing the refresh button again. It is not showing any change, just the above message. 

I was expecting that it has to show as shown below.

  | session ID: 14A2E524B25759452569011337AAD950.node2
  | You have hit this page 3 times
  | 

But some how it was not showing that.
Then I changed the URL as shown below


  | http://IPADDRESS:8280/Counter/index.jsp
  | 

I changed the port of the URL which is pointing to node2.
Now I was able to see the expected message.

My question here is , why should I need to change the port to node2. Why it is not going automatically, after I stopped node1. I was expecting that it has to goto node2 with out chaging any thing .

Then some body suggested that , it is the expected behaviour , since you haven't configured load-balancer.

But I was seeing when node1 and node2 was starting a message as shown below


  | 11:07:29,265 INFO  [JBossCacheManager] We are using mod_jk(2) for load-balancing. Will add JvmRouteValve.
  | 11:07:29,625 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
  | 11:07:30,390 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-166.35.136.77-8180
  | 11:07:30,515 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-166.35.136.77-8109
  | 

Even though I haven't configured any thing in JBoss or any thing in apache I was able to see the above messages when I start the node1 and node2.
If nodes are showing that message then I thought that load-balancer is working. (might be a default load-balancer).

Then I tried with load-balancer port (I thing it is 8009 in my case,since this is the default port which I saw,correct me if I am wrong).

I am seeing an error message "page cannot be displyed"

Can Any body suggest me why I need to change the port. Do I need to configure any thing.

By the way I am using JBOss 4.2.1 GA (on windows XP).

Thanks!
VVK 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098931#4098931

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098931



More information about the jboss-user mailing list