27
Clustering on same Machine By Anirban Sen Chowdhary

Clustering on same machine

Embed Size (px)

Citation preview

Clustering on same MachineBy Anirban Sen Chowdhary

Before we procced, we will take a look on what a Cluster is.

A cluster can be said as a set of Mule instances that acts as a unit. We can also say that, a cluster is a virtual server composed of multiple nodes and a servers in a cluster communicate and share information through a distributed shared memory grid. This means that the data is replicated across memory in different physical machines.

Reference :- https://docs.mulesoft.com/mule-user-guide/v/3.6/mule-high-availability-ha-clusters

How to configure cluster on a same machine ???

Mule server has the ability to form cluster for High Availability.To setup a cluster on a same machine we need to have multiple mule standalone server in the machine.Let’s consider we have two nodes or we can say two standalone server present in the same machine.

Configuring nodes for the cluster.

The first thing we will be doing is to change the -Dmule.mmc.bind.port value different in both the nodes. By default the -Dmule.mmc.bind.port value is 7777. But in order to configure nodes in cluster we need to have different -Dmule.mmc.bind.port for different nodes.The -Dmule.mmc.bind.port is present in wrapper.conf file under conf folder.

Let’s edit the wrapper.conf file of node2 and edit the value of -Dmule.mmc.bind.port to 7778. So, in node1 we have default value of -Dmule.mmc.bind.port as 7777 and in node2 we will have -Dmule.mmc.bind.port as 7778.

Let’s start both the nodes :- node1

And node2 :-

Adding nodes in mmc

To configure the clusters, we need to get into our Mule management console (mmc).Let’s log into our mmc.

After login we will click the servers tab and will add our servers here.

We will add a new server from add menu New Server as shown above.

We will add our first server node1, which has -Dmule.mmc.bind.port as 7777

It will register the server and add node1 in the list

Again if we click the Server tab, we will see that node1 has been listed as above.

Again we will repeat the same process to add node2 in the list, as we know node2 has been configured -Dmule.mmc.bind.port as 7778

So, we register our node2 in the list which have -Dmule.mmc.bind.port as 7778

So, we can see mule agent now registering node2 in the list.

So, under Server tab we can see both the nodes listed as below :-

Creating Cluster in mmc

We will now click on Add menu at the top and then select New Custer menu

We will give the name of the cluster say Anirban_Cluster in our case, and then add both the nodes under it and click Add button :-

After, waiting for a while we can see our cluster has been created :-

On clicking on the cluster Anirban_Cluster we can see, both the nodes :- node1 and node2 listed there as follows:-

Conclusion…..

Here it was a small demonstration of creating Clusters of node residing on same machine. This process can be used to create Clusters that may includes multiple nodes residing on same machine or different. And we can add as many nodes we like under a cluster but yes the cluster can have a maximum of 8 nodes and all the nodes should be up and running during adding a node into cluster.

So at the end I can only say that, let’s spread our knowledge and expand our Mule community.

Thank You