Index

JReport Enterprise Server Cluster

Cluster Overview

A JReport Enterprise Server Cluster is a group of servers that work together to provide cluster-wide shared resource, security, schedule and version services. There will be one admin server, one or more backup servers, and one or more slave servers in a JReport Enterprise Server Cluster.

JReport Enterprise Server Cluster provides the following major features:

Infrastructure

There can be three roles in a JReport Enterprise Server Cluster, such as admin server, backup server, and slave server.

Each server has its own responsibility. You can set a server to play a specific role in a JReport Enterprise Server Cluster by configuring its properties. The following list shows all the tasks each server in the server cluster can complete.

Business tasks

Administrative tasks

Run Reports Submit Scheduled Tasks Load-Balancing Fail-over Load-Balancing Administration Security Administration Resource Administration
Admin Server Y Y Y Y Y Y Y
Backup Server Y Y Y Y - - -
Slave Server Y Y Y - - - -

Admin Server

There should be one and only one admin server in a JReport Enterprise Server Cluster. In a JReport Enterprise Server Cluster, admin server maintains the shared resources and perform security administrative tasks. Admin server automatically detects the overloaded member servers and repartition tasks among all servers in the JReport Enterprise Server Cluster. You can monitor and administrate all the servers in the cluster using the admin server.

Backup Server

There should be at least one backup server in a JReport Enterprise Server Cluster. If the current admin server is shut down or breaks down, the backup server with the highest priority in the cluster will promote itself to be an admin server and take over all the administrative tasks.

Slave Server

There can be none or several slave servers in a JReport Enterprise Server Cluster. On a salve server, you can accomplish the task such as run a report, or submit a scheduled tasks. Slave servers can receive tasks directly from users or from the admin server. When the number of concurrent reports that running on a server is equal to the number of concurrent reports that is permitted by its license, the server will inform admin server. If another task is submitted on this server, it will be sent to admin server and admin server reallocates it to other server.

JReport Enterprise Server Cluster Features

This chapter describes the main features of JReport Enterprise Server Cluster. Some of these features are also available on API.

Administrating Security and Resources Centrally

In a cluster, users can accomplish all administrative tasks from a central place: the admin server.

When logging on to the cluster from the admin server as an administrator, there are some security administrative tasks that you can complete:

Load-Balancing

Here are the benefits for deploying load-balancing in JReport Enterprise Server Cluster.

Load-balancing process

  1. When a server in a cluster receives a view task or a scheduled task, it will send a load balancing request to admin server. The only difference between these two types of task is that, for the view task the first server will be treated as local server while for the scheduled task admin server will be treated as local server.
  2. Admin server selects a server in the cluster according to the load-balancing settings, and then sends IP address of the selected cluster server to the first server.
  3. The first server sends the task to the selected server.

Note:

The load-balancer can be bypassed if you prefer in some circumstances, you can directly specify a server in the cluster to perform a scheduled task or advanced-run task.

For information on how to specify a server manually instead of using the load-balancing feature for a task, please see

For how to enable or disable this feature, see

Session-level and Component-level load-balancing

When JReport Enterprise Server Cluster is integrated into a web server, it will support session-level and component-level load-balancing.

Load Balancing for Clustered Servers

Build-in load balancing algorithm

JReport Enterprise Server Clusters support several algorithms for load balancing clustered servers. Configurable algorithms for load balancing clustered servers are:

  1. Round Robin
    Admin server will check each server in a circle one by one, and allocates the task to a server whose number of concurrently running reports is less than the number of concurrent reports that is permitted by its license.
  2. Least Concurrent Reports (Min-load)
    Firstly, admin server will select all cluster servers whose number of concurrently running reports is less than the number of concurrent reports that is permitted by their license, and then among those servers, select the one that has the least number of concurrently running reports. If the local server is one of the qualified servers, it will be given high priority.
  3. Weighted Least Concurrent Reports (Weighted Min-load)
    Firstly, admin server will select all cluster servers whose number of concurrently running reports is less than the number of concurrent reports that is permitted by their license, and then among those servers, select the one that has the least Weighted number of concurrently running reports. If the local server is one of the qualified servers, it will be given high priority.



    Reference Note: For more details about Performance weight, please refer to User's Guide | JReport Enterprise Server Cluster | Cluster Weight
  4. Random
    Besides the first three load balancing algorithms, JReport Enterprise Server also supports randomly allocating tasks.

Note: You can choose the load balancing type by setting the property loadbalance.type in the server.properties file (%JREntServerInstallRoot%\bin).

Customizable load balancing based on the API

Users can write their own load-balancing based on the API included in JReport Enterprise Server. Please note that if you set load-balancing with API, it will take effect in place of other build-in load balance algorithms that you have set.

Load Balancer API Demo: We provide you with a demo (DemoLoadBalancer.java) to illustrate how to customize load balancing using APIs.

Suppose that your server has been configured to be an admin server, and you have several clustered servers.

Please take the following steps:

  1. Download DemoLoadBalancer.java from Jinfonet website.
  2. Compile this file. Before you compile this file, please add JRESServlets.jar to the classpath.

  3. Add DemoLoadBalancer.class to the classpath in JREntServer.bat.
  4. In server.properties, set loadbalance.custom_class=DemoLoadBalancer (if there is no such property entry, add one). Or, in the command line set -Dloadbalance.custom_class=DemoLoadBalancer.
  5. Launch JREntServer.bat, the customized loadbalancer DemoLoadBalancer will be applied.
  6. Submit some tasks to run, you will find that these tasks are randomly allocated to the clustered servers.


Reference Note: For more details, please refer to JReport Javadoc jet.server.api.cluster.LoadBalancer Interface.

Failover

Only one admin server takes charge of a cluster, we can make some servers in the cluster run as backup servers.

JReport Enterprise Server Cluster guards against the following failures:

Public Storage

You can use a disk (disk array) on a computer that does not play a role in a cluster as shared disk. All the temporary files and result files will be stored in this disk and they can be accessed from the servers in the cluster. This can improve the performance in running reports.

Here are the resources that can be stored in the shared disk:

Index