JReport Server Cluster main features

This section describes the main features of the JReport Server Cluster. Some of these features are also available through the API. With these features in mind, you will be better able to understand JReport Server Clusters and easily use them.

Administering security and resources

In a distributed cluster, you can accomplish all administrative tasks from any single node.

After logging onto the cluster from a clustered server as an administrator, certain security administrative tasks can be performed:

Load balancing

Here are the benefits of deploying load balancing in a JReport Server Cluster.

For scheduled tasks and tasks submitted from interactive reports (reports that run on Page Report Studio, Web Report Studio, JDashboard or Visual Analysis), JReport adopts different load balancing mechanisms to enable the servers to work more effectively.

Load balancing for interactive reports

When running interactive reports in a cluster environment, JReport's built-in dispatcher or a user-customized dispatcher would be used to do load balancing.

JReport's built-in dispatcher is implemented on report level. It uses an internal load balancing algorithm which relies on computing resources such as memory and CPU usage to balance load. When an interactive report is opened, JReport will compute those resources and then allocate the most suitable server to the report. All later requests from the report will be performed on the server thereafter.

Customized dispatchers, which are difficult to implement, would be used quite rarely and only for special cases. That's because, when using customized dispatcher to do load balancing for interactive reports, firstly you need to provide all server nodes in the cluster in advance, and what's more, only session level dispatcher could be implemented.

Load balancing for scheduled tasks

Cluster Scheduler Lease

Every clustered server has a scheduler, and among the schedulers those with a lease are active schedulers. When the time of a scheduled task arrives, active schedulers compete and the winner gets to trigger the schedule. When dispatching tasks, the server which has the active scheduler will select a server according to load balancing algorithm and allocate the task to it.

By default, in a JReport Server Cluster all nodes of the cluster compete to become the active scheduler when the time of a scheduled task arrives. If the scheduled task has been bound with a trigger, then the node who gets the trigger becomes the active scheduler. The active scheduler for the task will then determine the server that will be asked to run the scheduled report based on load balancing. The Cluster Scheduler Lease option allows you to limit the number of servers competing for each scheduled report by setting a Cluster Scheduler Lease Active Count. As long as the count is less than the total number of nodes in the cluster, only the nodes holding a lease will compete to become the scheduler for the report that is ready to run. Depending on the number of scheduled reports you have, you may find that setting the Lease Active Count to 1 or 2 will provide more overall throughput on the system so the other nodes never have to be concerned about scheduled tasks.

There are two additional parameters that can be set:

Load detection

There is a JReport Server residing in each node of a JReport Server Cluster. The main factor that affects load balancing is the number of concurrent reports that are running on every JReport Server. In order to avoid heavy load, every member server in the cluster has been enabled to send the number of concurrently running reports on it to the other cluster nodes.

Built-in load balancing algorithms

JReport Server Cluster supports several algorithms for load balancing clustered servers. Configurable algorithms for load balancing clustered servers are:

Failover

You can check the status of the clustered servers on JReport Server Monitor and notice the failure of any member server. If a member server is down, JReport cluster will remove it from the active clustered server list.

Member server failure

Notifying of server down

If you have enabled the notifying of server down feature, when a member server crashes or is disconnected with the cluster, JReport cluster will send a notification e-mail to a specified address.

Distributed resource storage

In a pure distributed cluster the resource files are not stored in a central place. Each server has its own directories to be able to hold all types of resources including catalogs, templates, dashboards and report results. The sharing of resources among servers is achieved via a copying mechanism. More copies of resources reduce the possibility of resources being lost if a server goes down. However, making too many copies consumes system resources by making copies that are never used.    

There are two copying scenarios. One is when a resource is saved, JReport will copy the resource to other randomly selected servers within the cluster, according to an argument: the number of copies allowed for this type of resource. The saved resource itself is regarded as a copy. That is, in the case when copy number is three, two other random servers will each be given a copy of the resource.

The other is on demand when a resource does not exist on the local server. JReport will search among the other servers for the resource and copy it to the local server.

The controllable number of copies argument is available to administrator users on the JReport Administration page > Cluster > Configuration panel. These types of resources support distribution: history resources which are resources saving into the versioning system, realm resources, CRD results that are cached report results, and memory storage related resources. You will be able to find the number of copies setting for each type.

The best number to use for each resource depends on two factors, how many points of failure do you want to tolerate and how often resources which are not local are requested by users.  For example on a 10 node system, you might want to still run in case any two nodes go down.  In this case, you would want the number of copies to be three.  Any two nodes could go down and there would still be one with a copy of the resources.  However, if there is a lot of on-demand requests that require copies you might find that a higher number actually provides better average performance for your users since they are not waiting for resources when they make on-demand requests.