4 Replies Latest reply on Mar 11, 2011 5:30 PM by Leandro Quiroga

    Changing cluster members on the fly

    Leandro Quiroga Newbie

      Hi, can I change the cluster members on the fly?

      I mean that if I have two load balancers (httpd servers) and ten JBoss, five working with one load balancer and the other five working with the other, can I take one JBoss and change the load balancer which work with, without having to restart the JBoss or the httpd server?

      Thanks in advance!

       

      Leandro

        • 1. Changing cluster members on the fly
          Paul Ferraro Master

          Yes, via JMX, execute the following operation sequence:

           

          stop(long, TimeUnit) : To gracefully stop the node on the current load balancer

          removeProxy(String, int) : To remove the current load balancer from the node's awareness

          addProxy(String, int) : To make the node aware of the other load balancer.

           

          Within 10 seconds, the web applications on that node should auto-enable on the new load balancer.

           

          There are some caveats to the above...

          * If you're using advertise (as opposed to a static proxyList), you'll need to use a unique advertise address/port on the new load balancer, which will require you to restart those jboss nodes that you want to switch to use the new load balancer.

           

          * If you have "autoEnableContexts" turned off, you'll need to trigger an additional enable() JMX operation.

           

          * If you're using HAModClusterService, you'll need to keep your servers isolated to unique partitions per load balancer (these servers in the new partition should use a different -g argument), otherwise, the removeProxy() will be broadcast to all nodes - and your application will lose service.  Technically, you can do this without restarting the server; by redeploying the DefaultPartition (with a new partition name).

          • 2. Changing cluster members on the fly
            Leandro Quiroga Newbie

            Thanks Paul.

            I have some troubles with this... when trying to invoke the stop() method via the web jmx console it throws:

             

            javax.management.IntrospectionException: Failed to find PropertyEditor for type: java.util.concurrent.TimeUnit

            org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:251)

            org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:223)

            org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:276)

            org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:100)

            org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:82)

            javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

             

            I've posted it in another post of this forum (http://community.jboss.org/message/544011)

             

            And which arguments should I use in the removeProxy() and addProxy() invocations?

            Thanks again!

            • 3. Changing cluster members on the fly
              Paul Ferraro Master

              Specifying an enum via jmx console works using the latest AS version, so it may be a bug with an older release.  You might also want to try via jconsole.

              The arguments for add/removeProxy(...) are the host name/address and port number of the load balancer (as indicated in your httpd.conf).

              • 4. Re: Changing cluster members on the fly
                Leandro Quiroga Newbie

                Paul Ferraro escribió:

                There are some caveats to the above...

                * If you're using advertise (as opposed to a static proxyList), you'll need to use a unique advertise address/port on the new load balancer, which will require you to restart those jboss nodes that you want to switch to use the new load balancer.

                So if I use advertise, I can't change the load balancer of a JBoss without restarting it?

                 

                Can I balance 2 clusters of JBoss with only one mod_cluster (in one httpd server)? Will that simplify the JBoss movements between clusters?

                 

                Thanks!

                 

                Leaqui