As of release 5.5, JasperReports® Server supports partial session replication and provides the beans to enable it. The app server usually manages the user session for a web application and is responsible for the policies that allow the session to be replicated in a cluster environment. However, you must also configure parts of JasperReports® Server, including the Ehcache component.
To configure JasperReports® Server nodes for partial session replication:
| 1. | step 5, Ehcache relies on other services and does not require IP multicasting. |
| 2. | On each node of the cluster, edit the file <web-app>/WEB-INF/web.xml to make the following changes: |
| a. | Locate the listener of class RequestContextListener and replace it with the listener of class TolerantRequestContextListener. The new listener class is given in comments that you need to uncomment as follows: |
| b. | Locate the ClusterFilter that's given in comments and uncomment it as follows: |
| c. | Locate the corresponding mapping for the ClusterFilter and uncomment it as well. You must also uncomment the <distributable> element. |
| 3. | On each node of the cluster, enable session replication in your app server or web container. For example, to enable session replication on Apache Tomcat 6.x, edit the file <tomcat>/conf/server.xml as follows. |
Add the Cluster definition within the <Engine name="Catalina" defaultHost="localhost"> configuration. In this example, 123.45.6.701 is the IP address of the node being configured. This example uses Delta Manager, but you can also use Backup Manager:
| 4. | On each node, edit the <web-app>/WEB-INF/ehcache.xml file to uncomment the following section: |
| 5. | JasperReports® Server's internal Ehcache must also be configured so that it can be distributed among all nodes. There are several distribution mechanisms available: |
| • | RMI – Remote Method Invocation is the simplest and fastest cache distribution mechanism. Use RMI distribution if your cluster runs on your own real or virtual computers, as long as their addresses will not change. You cannot use RMI distribution if your cluster is hosted in a cloud, such as with Amazon Redshift, because the IP addresses of the nodes may change. RMI distribution relies on IP multicast, which you must set up as described in step step 1. |
| • | JMS – Java Message Services can provide cache distribution for nodes in a cloud where IP addresses may change. Jaspersoft® provides a configuration for using the Apache ActiveMQ JMS Server. You must first install and configure ActiveMQ on one of the computers in your cluster. |
| • | Amazon SNS/SQS – Simple Notification Service and Simple Queue Service can provide cache distribution for nodes in Amazon Web Services (AWS). Using this option may incur additional costs as Amazon charges customers per API call. Amazon SNS/SQS support is experimental; the ActiveMQ JMS option also works for AWS and is the preferred method for Ehcache distribution. |
On each node, edit the <web-app>/WEB-INF/ehcache_hibernate.xml file as described below for your chosen distribution mechanism:
| • | For all distribution mechanisms comment out the section marked "NO CLUSTERING" as follows: |
| • | For RMI distribution, uncomment the RMI section on every node, and make sure the properties are correct for your IP multicast. |
| • | For JMS distribution, install the JMS server on one computer in your node. Then uncomment the JMS section on every node and set the providerURL properties to the address of your JMS server, in this example 123.45.6.701. There are 5 providerURL properties to set in all, only the first one is shown below: |
| • | For Amazon SNS/SQS, uncomment the AWS section on every node. Using Amazon SNS/SQS may incur additional costs as Amazon charges customers per API call. Amazon SNS/SQS support is experimental; the ActiveMQ JMS distribution also works for AWS and is the preferred method for Ehcache distribution. |
| 6. | On each node, edit the file <web-app>/META-INF/context.xml. Locate the Manager pathname near the end, and comment it out as follows: |
| 7. | Restart or redeploy JasperReports® Server on each node. |
Recommended Comments
There are no comments to display.