4 Replies Latest reply on Jun 11, 2009 4:12 AM by allen_lei

    How to add a clustering node?

    allen_lei

      Hi,
      I have a worker.properties define like this:

      worker.list=loadbalancer,status
      
      # Define Node 1
      worker.node1.port=8009
      worker.node1.host=192.168.0.101
      worker.node1.type=ajp13
      worker.node1.lbfactor=1
      
      # Define Node 2
      worker.node2.port=8009
      worker.node2.host=192.168.0.102
      worker.node2.type=ajp13
      worker.node2.lbfactor=1
      
      # Load-balancing behaviour
      worker.loadbalancer.type=lb
      worker.loadbalancer.balance_workers=node1,node2
      worker.loadbalancer.sticky_session=true
      
      worker.status.type=status
      worker.list=jkstatus
      worker.jkstatus.type=status


      Then I want to add a new JBoss instance(node3),and apache httpd is in running.How can I add a new worker node without stop and start apache?Does jk support dynamic load the worker.properties?If so,how to configure it?Or some other suggests?Thank you!

        • 1. Re: How to add a clustering node?
          brian.stansberry

          Just update the file and save it. The status worker rescans the file every 60 secs and updates the server.

          • 2. Re: How to add a clustering node?
            allen_lei

             

            "bstansberry@jboss.com" wrote:
            Just update the file and save it. The status worker rescans the file every 60 secs and updates the server.


            Thanks for your suggestion.I tried it by removing a node from the loadbalancer's balance_workers,and then after several minutes,I found there also existed requests forward to the removed node.But this didnt happen when I restarted Apache manually.It seems that the status worker not rescans the file every 60 secs.

            Something wrong?Your reply would be very appreciated.

            PS:My testing environment is Windows xp sp2 + Apache 2.2.11.

            • 3. Re: How to add a clustering node?
              brian.stansberry

              My apologies. I've had that "just update workers.properties" idea in my head for a long time, don't know where it came from, but it's just wrong.

              A couple suggestions for you:

              1) If you are using JBoss 5, try mod_cluster

              http://www.jboss.org/mod_cluster/

              One of the primary motivations for its creation was the dynamic registration / unregistration of backend nodes as they come and go.

              2) Restart httpd gracefully

              apache -k graceful


              See "Graceful Restart" section of http://httpd.apache.org/docs/2.2/stopping.html for more on what that does.

              • 4. Re: How to add a clustering node?
                allen_lei

                I see,thanks.

                I'm now using JBoss 4.x and hava not used JBoss 5 yet.So I will try the JBoss 5 with mod_cluster later.

                I think "gracefully restart apache" is a appropriate idea for now.