Clustering with JBoss Technical Note Version 1.2 29 December 2011 2011 Active Endpoints Inc. is a trademark of Active Endpoints, Inc. All other company and product names are the property of their respective owners. 2011 0
Content Introduction... 3 Clustering... 3 Nodes Clustering... 3 Failover... 4 Load Balancer... 4 and JBoss Clustering... 5 Pre-requisites... 5 Configuring JBoss Cluster... 6 Verifying the Cluster s Configuration... 7 Testing Clustering on JBoss... 8 Scenario A cluster working under normal conditions... 8 Scenario B Failure with single node (new request)... 8 Scenario C In-flight BPEL Process Tests... 8 Load Balancer... 9 Deploying Services to a Cluster... 9 Appendix Frequently Asked Question...10 About Active Endpoints...11 Copyright 2011, Active Endpoints, Inc. Page 2 of 11
Introduction Clustering leverages the underlying application server s clustering architecture as summarized here: Application Tomcat JBoss WebLogic WebSphere Clustering Technology JGroups application level JGroups server level Cluster MBeans server level Cluster MBeans - server level This technical note addresses the clustering of nodes on JBoss. Nodes Clustering Using the peer-to-peer clustering strategy, any number of application server nodes can be placed in the cluster as depicted here. For sake of brevity, the examples in this document will just use two. Copyright 2011, Active Endpoints, Inc. Page 3 of 11
App Node 1 App Node 2 ` HTTP Load Balancer... App Node n Database Failover In the peer-to-peer clustering, there is no traditional Hot/Cold standby configuration. All nodes participate in the round-robin processing of transactions. This permits load balance to occur continuously and guard against the failover of 1 or more nodes in the cluster. Load Balancer A load balancer needs to be configured to direct the traffic to the appropriate Node. This can be either a hardware device or a software based load balancer. The Apache Web can be configured (see Technical Note, High Availability Configuration of Central with Apache Load Balancer) to route HTTP based requests to nodes in the cluster (e.g. Application Node1 & Application Node2). When the client issues his/her request to the web server, the load balancer component will route the request to the appropriate server node. Copyright 2011, Active Endpoints, Inc. Page 4 of 11
and JBoss Clustering This example illustrates how to setup clustering and failover with JBoss. The configuration of JBoss Cluster is at the server level and not the application level. JBoss Node1 Mod_jk ` HTTP Load Balancer Database JBoss Node2 Mod_jk Pre-requisites To perform clustering and failover with JBoss, you need to assemble the following: JBoss Application s (2) Database (MySQL, Oracle DB, MS SQL, DB2) Load Balancer (or Apache Web ) Edition or Data Center Edition See http://www.activevos.com/products/activevos/certified-systemsupport for a list of supported and certified platforms and versions. Copyright 2011, Active Endpoints, Inc. Page 5 of 11
Configuring JBoss Cluster You would create 2 JBoss Application server nodes. This document was created using JBoss 5.1.0 GA. Please check JBoss documentation for details about other JBoss versions. The details of JBoss Clustering used in this document are here. The JBoss all configuration (JBOSS_HOME/server/all) fully enables JBoss clustering. Before starting, it is recommended that you copy the JBOSS_HOME/server/all to JBOSS_HOME/server/<your name> such as node1 or noden to keep it separate from the built-in /all directory. To start each JBoss node use the run.sh or run.bat command, from the JBOSS_HOME/server/bin with the following parameters: -c the config file from the JBOSS_HOME/server/ directory (all, node1, node2, etc.) -g the name you assign to this specific node -u the multicast address used by the cluster to communicate among nodes (the same for all nodes in a cluster) -b the IP address the node will bind to (listen on) -Djboss.messaging.PeerID= unique numeric id (1 thru n) for node On one server machine you might start the first cluster node with run.bat c all g Node1 -u 235.255.100.100 -b 192.168.1.128 Djboss.messaging.PeerID=1 and then a second server machine you might start the second cluster node with run.bat c all g Node2 -u 235.255.100.100 -b 192.168.1.129 Djboss.messaging.PeerID=2 On each JBoss node, you would: install the server configure server to reference shared database In normal operation, one would normally start the DBMS first, then the load balancer, and then (in no particular order) the JBoss cluster nodes. Copyright 2011, Active Endpoints, Inc. Page 6 of 11
The Active VOS should be started automatically by JBoss. Both JBoss nodes and the Active VOS servers running on them will recognize their intra-cluster peers as they come on line. Verifying the Cluster s Configuration Before verifying cluster setup for the server clustering, it is important to insure that network connectivity between the clustered machines is working. 1. In machine 1 [SENDER ],open a command prompt and navigate to the JBOSS_HOME > server > all > lib directory and issue the command: java -cp jgroups.jar org.jgroups.tests.mcastsendertest - mcast_addr 228.1.221.1 -port 45566 2. In machine 2 [RECEIVER], open a command prompt and navigate to the JBOSS_HOME > server > all > lib directory and issue the command: java -cp jgroups.jar org.jgroups.tests.mcastreceivertest - mcast_addr 228.1.221.1 -port 45566 3. After hitting the return key in the machine 1, enter some text and then in your machine 2, verify if you receive the same text that you typed in machine 1. 4. After testing 1 to 3, perform the same set of steps now by swapping the sender and the receiver commands of machine 1 and 2. Copyright 2011, Active Endpoints, Inc. Page 7 of 11
Testing Clustering on JBoss After the cluster has been established, you can execute the following testing scenarios to verify the cluster is working under normal and failure conditions. Scenario A cluster working under normal conditions 1. Verify cluster setup - Use Admin console GUIs to verify a. is licensed correctly and running b. BPEL process correctly deployed on both servers 2. Submit BPEL service request (new request) Use client application to send BPEL request to Apache Web / Load balancer a. Web Services Explorer SOAP_UI, web service browser tool can be used for simple testing Verify BPEL process executes correctly Scenario B Failure with single node (new request) After verifying cluster is operational, the next scenario is to submit a request when Node1 is down. Submit BPEL service request Use client application to send BPEL request to Apache Web / Load balancer SOAP_UI, web service browser tool can be used for simple testing Verify request is routed to operational Node Scenario C In-flight BPEL Process Tests 1. Ensure at least 2 nodes are running a. Launch a long running transaction using client application b. Test using BPEL process containing synchronous invokes 2. Test using BPEL process containing asynchronous invokes 3. Locate Node/ that BPEL process is running on 4. Terminate Node/ 5. Verify that Processing continues on one of Remaining s/nodes Copyright 2011, Active Endpoints, Inc. Page 8 of 11
Load Balancer Refer to the Introduction section. Deploying Services to a Cluster The following summarizes the steps that occur when deploying process definitions to a cluster. App Node 1 BPEL App Node 2 BPEL... App Node n BPEL ` Database 1. Developer/System Admin deploys (BPEL process) services using Eclipse deployment wizard or Administrative GUI, the processes are deployed to a single node in cluster. 2. persists process definitions in a shared database. 3. sends out notifications to all other nodes in JBoss cluster: Via the JGroups mechanism, the active members of the cluster group are known. Through IPC (interprocess process communication), the other nodes (e.g. Node 2 through Node N) are notified of the new BPEL process. Copyright 2011, Active Endpoints, Inc. Page 9 of 11
4. Each node in the cluster retrieves BPEL process definitions from the database. 5. Each node now has a new BPEL process definition available for execution. Appendix Frequently Asked Question 1. Can we integrate with the BPM platform using a Virtual IP address or hostname meaning the integration can make use of the cluster configuration? Yes. The exact configuration would depend on the hardware or software load balancing mechanism you select. does leverage clustering capabilities of the application server. 2. Does have a monitoring daemon for clustering? The clusters work in a peer to peer basis. From a single admin console, you can see the activity across the cluster. Each server emits heart beat messages that are broadcast to other members in the cluster. will leverage the application server clustering capabilities. For example, if is deployed on JBoss application server, the JBoss clustering communication solution (JGroups) will be used. Copyright 2011, Active Endpoints, Inc. Page 10 of 11
About Active Endpoints Active Endpoints (www.activevos.com) is the leader in serviceoriented BPM software for process automation. empowers project teams to create business process management (BPM) applications using services, making their businesses more agile and effective. promotes mass adoption of SOA-enabled BPM applications by focusing on accelerating project delivery time with a complete, affordable and easy-to-use system. Active Endpoints is headquartered in Waltham, MA with development facilities in Shelton, CT. To find out how Active Endpoints can help your business, visit http://www.activevos.com, call +1 781 547 2900 and press 1 for Sales, or email us at info@activevos.com. Copyright 2011, Active Endpoints, Inc. Page 11 of 11