Failover and Load Balancing in Jasper Server

Posted on by By Nikhilesh, in Business Intelligence, Jaspersoft, Open Source Business Intelligence | 0

Failover and Load Balancing in Jasper Server

Installing jasper instances

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Grab The 30 Days Free Trail

For sample configuration I installed two Jasperserver instances:

  • On two separate application server (2 tomcat servers running on different port), and with
  • Single repository (OracleDB)

For detailed installation steps refer

I installed jasper server instances on localhost. These jasper servers are running on:



Installing Apache web server

  1. Download the Apache HTTPD Web Server from the Apache web site. Be sure to download the httpd_2.2.22-win32-x86-open_ssl MSI installer here:
  2. Double click the MSI file saved on your Windows Desktop.

Apache HTTP server 2.2-Installation wizard will open.

  1. Click on Next button.
  2. Accept the terms in License agreement and click on Next button.
  3. On the next window again click next.
  4. Next,
  • fill in all the text boxes with the following information:

“Network Domain”: localhost

“Server Name”: localhost

“Administrator’s Email Address”: your email address

  • Make sure the radio button “for all users, on port 80, as a service – recommended” is selected.
  • Click on Next.
  1. When asked about the Setup Type, select “Typical” and click next.
  2. Give the Path where you want to install all the packages and scripts. I chose this path E:\Jaspersoft\Apache2.2\

(The ending backslash is important)

Click on OK after providing the installation path.

  1. Click “Install” to begin the installation.
  2. Once the Apache installation software has finished installing all the files on your computer, you will see a final window letting you know the installation was a success. Click the “Finish” button.
  3. To check that the software was in installed successfully, open browser and type “http://localhost/” into the address bar. You should see a page that looks like this or the words It Works!

Installing mod_jk

Mod_jk is an Apache web server module that allows the Apacheweb server to interface with the Tomcat application server. Installing it and configuring it are the keys to getting the web server and the application server working together.

Download the latest version of mod_jk

New versions of mod_jk are released as source packages, and as binary packages for select platforms.  Both are available for download from the Apache Tomcat Connector project download page.Currently, the following platforms receive binary releases: AIX, FreeBSD, iSeries, Linux, Mac OS X, Netware, Solaris, and Windows (32- and 64-bit releases).

Download the most recent release.

I downloaded “tomcat-connectors-1.2.40-windows-i386-httpd-2.2.x”.

Installing mod_jk

  1. Extract the zip file.
  2. Copy and paste it inside modules directory of Apache web server (E:\Jaspersoft\Apache2.2\modules).

Jasper server configuration for failover

  1. On each jasper server instance, edit the file <web-app>/WEB-INF/web.xml.
  • 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:


                <!--Replace the default spring listener with the Tolerant listener to enable replication-->





  • Locate the ClusterFilter that is given in comments and uncomment is as shown below:




  • Locate the corresponding mapping for the ClusterFilter and uncomment it as well. You must also uncomment the <distributable> element as well.





2. On each jasper server instance, 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:

  • Within the Engine tag add jvmRoute property as shown below:
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node2">
  • Add the Cluster definition within the <Engine name=”Catalina” defaultHost=”localhost” jvmRoute=”node2″> configuration. This example uses Delta Manager.
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8">
    <Manager     className="org.apache.catalina.ha.session.DeltaManager"
    <Channel className="">
        <Membership className="org.apache.catalina.tribes.membership.McastService"

        <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
            <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
        <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
        <Interceptor className=""/>
        <Interceptor className=""/>
    <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>
    <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
    <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
    <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

3. On each jasper server instance, locate the following two files and uncomment the same two sections in each file:

  • web-app>/WEB-INF/ehcache.xml
  • web-app>/WEB-INF/ehcache_hibernate.xml

<cache name=...
            properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
                        replicateUpdatesViaCopy=false, replicateRemovals=true"/>
            properties="bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000"/>

Load Balancer configuration

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Grab The 30 Days Free Trail

The following changes configure the Apache HTTP server (httpd) as a load balancer.

1. Locate httpd.conf file in E:\Jaspersoft\Apache2.2\conf
2. Add following line to the end of the httpd.conf file

Include conf/mod-jk.conf

3. Create the following two files in the /conf folder of your httpd server.

4. Create the following two files in the /conf folder of your httpd server.

  • mod_jk.conf
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/
# Where to find
JkWorkersFile conf/
# Where to put jk logs and memory
JkLogFile logs/mod_jk.log
JkLogFile logs/mod_jk.shm
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
#JkMount /* loadbalancer
JkMount /jasperserver-pro loadbalancer
JkMount /jasperserver-pro/* loadbalancer
# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
#JkMountFile conf/
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm
#JkShmFile /var/log/httpd/mod_jk.shm
# Add jkstatus for managing runtime data
<Location /jkstatus>
JkMount status
Order deny,allow
Allow from all

 # Define list of workers that will be used
# for mapping requests
# Define Node1
# modify the host as your host IP or DNS name.
# Define Node2
# modify the host as your host IP or DNS name.
# Load-balancing behaviour
# Status worker for managing load balancer


Best Open Source Business Intelligence Software Helical Insight is Here


A Business Intelligence Framework

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments