Download - Clustering of Mule ESB
Clustering of Mule ESB
Sreekanth KondapalliIntegration Architect
Management Tool for Clustering
MMC Creating Clustering Disband Clustering
A cluster may contain from one to eight nodes Clustering Programmatically(Alternative)
Management Console REST API
Pre-requisites
Atleast two configurations are expected(Current Scenario) Windows Ubuntu
In Windows Mule Run time 3.7.x (ESB) MMC 3.7 configured in Tomcat Server
Ubuntu Configuration of Ubuntu VM Mule runtime 3.7.x (ESB)
Warning – Pre requisite
While creating a cluster, all the nodes selected for the cluster must implement the same agent version and the same Mule ESB version.
Upgrade a server so that it matches the Mule ESB version of the other cluster nodes, first unregister the server then upgrade it to the required version of Mule.
Then create the cluster with the upgraded server (and the other servers) as nodes.
Registering Server1 – MMC - Windows Install/explode Mule runtime 3.7.2 Install/explode MMC 3.7 Start Mule runtime 3.7.2 /MULE_HOME/bin/mule.bat Start Tomcat server (running on 8585 port) /apache_tomcat_home/bin/startup.bat
Registering Server1 – MMC – Windows Contd..
Register server in MMC Login to MMC 3.7 application. http://localhost:8585/mmc-3.7.0/
Username: admin Password: admin
Observe for the server
Register server in MMC. Contd..
If the Server is not seen Select Server
In the List select the server Click Register Button
Registering Server Successful
Set up on Server2 - Ubuntu Install/Explode Mule runtime 3.7.2 (please use the same runtime of
windows by copying via WinScp to Ubuntu VM) Start Mule runtime 3.7.2 by executing mule file located in
<MULE_HOME>/bin/ ./mule start
Start Server2 - Ubuntu Navigate to log folder and verify the server console to
Register Server2
Navigate to MMC 3.7.0 and configure Mule runtime 3.7.2 running in Ubuntu
Manual configuration of Mule Runtime in MMC. Click on Unregistered link. (Please note that Mule runtime running in
Ubuntu is not listed) Click on New Server link
Server Name: Ubuntu Mule Agent URL: http://192.168.56.101:7777/mmc-support Click Add
Register Server2. contd..
Acknowledgement
Two Servers registered Click on All link, you can see Ubuntu server is added to
Cluster configurations of 2 Server nodes in MMC
Click on Add and select New Cluster
Cluster configurations of 2 Server nodes in MMC. Contd..
In the New Cluster screen, 2 servers will be listed. Specify Cluster Name: DemoCluster Select 2 servers which are configured in previous step from Available
Nodes Click >> to move the servers to Cluster Nodes
Check Multicast is disabled in my network.
Cluster configurations of 2 Server nodes in MMC. Contd..
Cluster configurations of 2 Server nodes in MMC. Contd..
Click Add to create Cluster nodes
Cluster configurations of 2 Server nodes in MMC. Contd..
Once Add is clicked both the servers will be restarted and ‘All’ link will show only 1 DemoCluster instead of 2 server instances.
Cluster configurations of 2 Server nodes in MMC. Contd..
After both servers restart then we will see DemoCluster up and running.
Demo Application
Application Use Case: I have created an application which will generate 500 string objects and assign to payload using Expression component. Used ‘For Each’ in the next step of flow and added a VM Inbound connector. Created a sub flow using VM outbound connector and logger to log the message. In the logger, I am trying to print the server host name and the payload (String value) to identify the node which has processed the message. And finally, I have printing success message before ending the flow.
Mule Flow
Deployment of Application to Cluster Click on the Deployment tab in the MMC
Deployment of Application to Cluster. Contd..
Click on New Deployment Name: ClusterDemo Applications: Click Upload New Application Choose the mule deployment
file (cluserflow.zip) Servers: Select the ClusterName from drop down (ClusterDemo) Click Deploy
Deployment of Application to Cluster. Contd..
Application is deployed in both the nodes of Cluster.
Test Application Run the application using any of the node IP i.e localhost or
192.168.56.101 http://localhost:8081/clusterflow
Test Application – Verify Log Server 1 Log from both the servers (I have attached the complete logs from
both servers for your reference)
Test Application – Verify Log Server 2
END