Sunday 29 November 2015

Jgroup & infinisoan in JBOSS

If you are using clustering at a minimum you need the jgroup and infinisoan extentions enabled. The Ha and Full-Ha profiles come preconfigured with these extension and subsystems enabled.

Jgroup extenstion , which provide the communication between servers and is the mechanism for diagnosing and discovery of cluster capabilities.

The Jgroup  subsystem provides all the communication mechanisms for how the servers in a cluster talk to each other. EAP is preconfigured with Two Jgroup stacks.

1. UDP : the node in the cluster use the udp multi-casting  to communicate with each other.

2. TCP : the nodes in the custer use TCP to communicate with each other.

 By default stack is UDP, but you can change this to TCP if your environment does not allow multicasting.

A multicast address, also called a group address, is a single IP address for a set of hosts that are joined in a multicasting group.multi cast is nothing but delivery of message to a group of hosts on a single transmission.

So In a JBoss cluster, the servers must communicate with each other to send and receive messages. The communication is done using Jgroups channel. Jgroup library provides the communication support between the servers in the Cluster. It provides a channel on which the communication occurs. This channel handles different tasks such as managing the nodes available in the cluster, detecting failure nodes, identifying new nodes e.t.c.Jgroups also allows to maintain state that is replicated across cluster. Http Session in a web server is replicated to all the servers in the cluster, so that if one node fails the user can log in by the session that is already available.

So when an update is done to a session, the variables that are updated are serialized and send to all other server and the session is updated. So In order for the JBoss cluster to work.


Infinispan is extension, which provide the caching capabilities and object replication 


In a cluster environment , similar data is replicated onto each node in the cluster.this data is stored in cache, and caching mechanism and features are implemented by a framework called infinispan. 

A cache is defined with in a cache container. There are four preconfigured cache containers in the ha and full-ha profiles. 

1. web : for session replication
2. hibernate : for entiy caching
3. ejb: for stateful session bean replication
4.singleton : for singleton caching


The web, hibernate and ejb caches are used by developers to cache java component. in clustering , the node use a cache in the cluster container configured for replicating objects efficiently and effectively over a large cluster of nodes.


There are four different types of caches

1.local
2.invalidation
3.replicated
4.distributed




No comments: