1 Reply Latest reply on Jul 3, 2006 5:38 PM by chahua wang

    Always query one instance with a greater port number for 2 i

    chahua wang Newbie

      Hi, Folks,

      I set up 2 instances in one machine with different port numbers.
      it works fine last week, 2 instances can handle the requests one by one.
      Today I restart my computer, the requests always go to the greater port number. Foe example:

      I set

      worker.node1.port=8009
      
       worker.node2.port=8109

      so all queries always go to node2. (8109>8009)

      if I exchange the port, all queries will go to node1.


      Also I set
      worker.node1.port=8209
      
       worker.node2.port=8109

      the conclusion is the right, all queries go to node1 (because 8209>8109).

      Could you tell me what is wrong? Thank you.


      Chwang


      this is my workers.properties.

      workers.apache_log=/var/log/httpd/
      
      # Define Node1
      worker.node1.port=8009
      worker.node1.host=localhost
      worker.node1.type=ajp13
      worker.node1.lbfactor=1
      worker.node1.local_worker=1
      worker.node1.cachesize=10
      
      
      # Define Node2
      worker.node2.port=8109
      worker.node2.host=localhost
      worker.node2.type=ajp13
      worker.node2.lbfactor=1
      worker.node2.local_worker=1
      worker.node2.cachesize=10
      
      
      # 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
      
      
      


        • 1. Re: Always query one instance with a greater port number for
          chahua wang Newbie

          hi, I have found some reason.
          I have found the reson is related to

          worker.loadbalancer.sticky_session=1


          if I set

          worker.loadbalancer.sticky_session=0


          They will swtich loading.

          But sticky_session=1 doesn't work well.

          for example, when I send a request to the node1 through browser,
          I got a session ID, then I re-loaded browser, the request went to node2. According to set up sticky_session=1, it should still go to node1.
          Please tell the reson why?

          Chwang