-
1. Changing cluster members on the fly
pferraro Mar 9, 2011 3:41 PM (in response to leaqui)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
leaqui Mar 10, 2011 12:39 PM (in response to pferraro)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
pferraro Mar 10, 2011 1:02 PM (in response to leaqui)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
leaqui Mar 11, 2011 5:30 PM (in response to pferraro)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