0 Replies Latest reply on Jul 7, 2010 9:53 AM by saswata mandal

    Tomcat LoadBalancing Problem !!

    saswata mandal Newbie

      Dear Experts,

       

           We have two JBoss nodes in a cluster in two seperate machines.

       

      Apache Web Server and MOD_JK (for Load Balancing between two Nodes) are installed in the third machine.

       

      The two Nodes are configured as workers in Apache Config using workers.properties :-

       

      # Define list of workers that will be used for mapping requests
      worker.list=loadbalancer,status

      # Define Node1

      # modify the host as your host IP or DNS name.
      worker.node1.port=8897
      worker.node1.host=192.456.232.3
      worker.node1.type=ajp13
      worker.node1.lbfactor=1
      #worker.node1.cachesize=10
      #worker.node1.cachesize OR worker.node1.connection_pool_size can be used.

       

      # Define Node2

      # modify the host as your host IP or DNS name.
      worker.node2.port=8897
      worker.node2.host= 192.456.232.2
      worker.node2.type=ajp13
      worker.node2.lbfactor=1
      #worker.node2.cachesize=10
      #worker.node2.cachesize OR worker.node2.connection_pool_size can be used.

       

      # Load-balancing behaviour
      worker.loadbalancer.type=lb
      worker.loadbalancer.balance_workers=node1,node2
      worker.loadbalancer.sticky_session=1
      #worker.list=loadbalancer
      # Status worker for managing load balancer
      worker.status.type=status

      .

       

      But , when URLs are requested through Apache Web server , all the URLs are served by the Node2.

       

      None of the URLs goes to the Node1.

       

      The MOD_JK.log lists the following for the Node1 :-

       

      [Wed Jul 07 13:36:18 2010][4460:4436] [debug] jk_connect.c (604): trying to connect socket 1504 to 192.168.232.3:8898
      [Wed Jul 07 13:36:39 2010][4460:4436] [info] jk_connect.c (622): connect to 192.168.232.3:8898 failed (errno=60)
      [Wed Jul 07 13:36:39 2010][4460:4436] [info] jk_ajp_common.c (959): Failed opening socket to (192.168.232.3:8898) (errno=60)
      [Wed Jul 07 13:36:39 2010][4460:4436] [error] jk_ajp_common.c (1585): (node1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
      [Wed Jul 07 13:36:39 2010][4460:4436] [info] jk_ajp_common.c (2540): (node1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
      [Wed Jul 07 13:36:39 2010][4460:4436] [debug] jk_ajp_common.c (2397): retry 1, sleeping for 100 ms before retrying
      [Wed Jul 07 13:36:39 2010][4460:4436] [debug] jk_ajp_common.c (1579): (node1) all endpoints are disconnected.
      [Wed Jul 07 13:36:39 2010][4460:4436] [debug] jk_connect.c (480): socket TCP_NODELAY set to On
      [Wed Jul 07 13:36:39 2010][4460:4436] [debug] jk_connect.c (604): trying to connect socket 1504 to 192.168.232.3:8898
      [Wed Jul 07 13:37:00 2010][4460:4436] [info] jk_connect.c (622): connect to 192.168.232.3:8898 failed (errno=60)
      [Wed Jul 07 13:37:00 2010][4460:4436] [info] jk_ajp_common.c (959): Failed opening socket to (192.168.232.3:8898) (errno=60)
      [Wed Jul 07 13:37:00 2010][4460:4436] [error] jk_ajp_common.c (1585): (node1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
      [Wed Jul 07 13:37:00 2010][4460:4436] [info] jk_ajp_common.c (2540): (node1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
      [Wed Jul 07 13:37:00 2010][4460:4436] [error] jk_ajp_common.c (2559): (node1) connecting to tomcat failed.

       

       

      Please help to find a solution !!

       

      Thanks & Regards

      Saswata Mandal.