4. Agenda
What is Clustering and Server Group?
Clustering and Server Group Architecture.
Live Demonstration on Clustering and Server Group.
5. What is Clustering?
● Clustering is group of the nodes that act as an single unit. There can be up to 8 servers in
single cluster.
● Application instances in a cluster are aware of each other, share common information,
and synchronize statuses.
● You must create the Mule runtime engine instances and add the Mule servers to
Anypoint Runtime Manager.
7. Multicast V/S Unicast Clustering
● A unicast cluster requires that you configure the IP addresses of the nodes in the cluster.
If a server has multiple interfaces, use the internal IP address that allows the node to
communicate directly with other nodes. Clustering across different subnets is not
supported.
● A multicast cluster comprises servers that automatically detect each other. Servers that
are part of a multicast cluster must be on the same network segment.
● One advantage of multicast clusters is that the server status doesn’t need to be Running
to configure it as a node in a cluster. Another is that you can add nodes to the cluster
dynamically without restarting the cluster.
● Check with your network administrator to determine if multicast is allowed within your
network, because many networks block multicast functionalities.
9. Benefits Of Clustering
● Automatic coordination of access to resources, such as files, databases, and FTP sources.
The Mule runtime engine cluster automatically manages which node (Mule runtime engine)
will handle communication from a data source.
● Automatic load balancing of processing within a cluster.
If you divide your flows into a series of steps and connect these steps with a connector such
as VM, each step is put in a queue, making it cluster-enabled. The cluster of Mule runtime
engines can then process each step in any node to better balance the load across nodes.
● Raised alerts.
You can set up an alert to appear when a node goes down and when a node comes back up
10. Primary Node Concepts
● In an active-active model, there is no primary node. However, one of the nodes acts as
the primary polling node. This means that sources can be configured to only be used by
the primary polling node so that no other node reads messages from that source.
● This feature works differently depending on the source type:
● Scheduler source: only runs in the primary polling node.
● Any other source: defined by the primaryNodeOnly attribute. Check each connector’s
documentation to know which is the default value for primaryNodeOnly in that
connector.
12. Server Group
● A server group is a set of servers that act as a single deployment target for applications so
that you don’t have to deploy applications to each server individually.
● Deploying applications to servers in server groups provides redundancy so you can restore
applications more seamlessly and quickly, with less downtime.
● Unlike clusters, application instances in a server group run in isolation from the application
instances running on the other servers in the group. If you experience concurrency issues with
server groups, consider grouping servers in clusters.
15. Use Case 1: Application Deployed on a Cluster
With a Queue Listener (primaryNodeOnly=false)
In JMS connector configuration, use can configure attribute primaryNodeOnly to define whether a
message will be only picked by the primary node or any node in the cluster. By default, the
primaryNodeOnly attribute is false.
In other words:
● if primaryNodeOnly attribute is false, the clustering works in active-active mode.
● if primaryNodeOnly attribute is true, then clustering works in active-passive mode.
16. Use Case 1: Application Deployed on a Cluster
With a Queue Listener (primaryNodeOnly=false)
17. Use Case 2: Application Deployed on a Cluster
With a Queue Listener (primaryNodeOnly=true)
When primaryNodeOnly is true, all messages will be delivered to the primary node in the cluster.
If the primary node goes down, any one of the other nodes in the cluster will become primary and
the message will be delivered to that node.
18. Use Case 3: Application Deployed on a Cluster
With Topic Listener (primaryNodeOnly=true)
In case of the Topic listener, you need to make sure that if a message needs to be delivered to
only one node that both nodes don't process the same message. To do this, make sure that
primaryNodeOnly attribute is true on JMS connector configuration.
19. Use Case 4: Application Deployed on a Server
Group With a Topic Listener
● A server group is basically a group of nodes that are isolated from each other and work
independently. If an application is deployed to a server group with a topic listener, then all the
nodes in the server group receive the same messages. The topic has a multicast property that
sends the same message to multiple consumers.
20. Use Case 5: Application Deployed on a Server
Group With a Queue Listener
In the case of a server group with a queue listener, the message will be only delivered to one of
the nodes in the server group as the queue has a property whereby its delivers one message to
one consumer, even if multiple consumers are listening to the same queue. It will send message
randomly to one of the consumer.