32.4. Load Balancing at the EJB Level

This section describes how to configure JOnAS to run the following architecture:

Figure 32-4. Load Balancing

32.4.1. CMI Principles

CMI is a new ORB used by JOnAS to provide clustering for load balancing and high availability. Several instances of JOnAS can be started together in a cluster to share their EJBs. It is possible to start the same EJB on each JOnAS, or to distribute their load. A URL referencing several JOnAS instances can be provided to the clients. At lookup time, a client randomly chooses one of the available servers to request the required bean. Each JOnAS instance has the knowledge (through JavaGroups) of the distribution of the beans in the cluster. An answer to a lookup is a special clustered stub, containing stubs to each instance known in the cluster. Each method call on the home of the bean can be issued by the stub to a new instance, to balance the load on the cluster. The default algorithm used for load distribution is currently a weighted round-robin.

32.4.2. CMI Configuration

NoteNotes:
 

The multicast address and group name must be the same for all JOnAS servers in the cluster.

If Tomcat Replication associated to cmi is used, the multicast addresses of the two configurations must be different.