This example demonstrates how to configure a JReport Enterprise Server cluster by modifying the server.properties file on each JReport Enterprise Server. There will be three computers in the cluster. They are node0, node1 (IP address: 127.0.0.1) and node2 (IP address: 127.0.0.2). All JReport Enterprise Server in the cluster use HSQLDB as the server system database.
Take the following steps to set up the cluster:
Install JReport Enterprise Server to C:\JReport\Serveradmin on node1. Launch JReport Enterprise Server on node1 and then shut it down. Open the server.properties file in C:\JReport\Serveradmin\bin, and modify it as below:
cluster.server.backup=false
cluster.server.admin=true
server.rmi.port=1129
Add the following properties:
loadbalance.type=1
resource.share.temp.dir=K:\temp
resource.share.hist.dir=K:\history
resource.share.realm.dir=K:\realm
resource.share.properties.dir=K:\properties
resource.root=K:\jreports
Then edit dbconfig.xml in <install_root>\bin by making the system database be in the shared properties directory K:\properties as set above.
Install JReport Enterprise Server to C:\JReport\Serverbackup on node2. Launch JReport Enterprise Server on node2 and then shut it down. Open the server.properties file in C:\JReport\Serverbackup\bin, and modify it as follows:
cluster.server.backup=true
cluster.server.admin=false
cluster.admin.rmi.port=1129
server.rmi.port=1130
Add the following properties:
loadbalance.type=1
resource.share.temp.dir=K:\temp
resource.share.hist.dir=K:\history
resource.share.realm.dir=K:\realm
resource.share.properties.dir=K:\properties
resource.root=K:\jreports
Then edit dbconfig.xml in <install_root>\bin by making the system database be in the shared properties directory K:\properties as set above.
C:\JReport\Serveradmin on node1 to the network drive K. Empty the other four folders while keeping the jreports folder intact, since the resources in this folder will be used in the following steps.JReport Enterprise Server is ready for service.
Launch the backup server on node2. In the Command Prompt window, you will see the following information:
Connecting to admin server [127.0.0.1:1129].
Connected to admin server [127.0.0.1:1129] successfully.
This means that the cluster has been configured and launched successfully.
Only after a server has been added to the predefined server list, can it be tracked and monitored by the JReport Server Monitor.