#### Configuring the backup servers

You can configure the backup server by using the JReport Administration page or the server.properties file.

##### Using the JReport Administration page

1. Launch JReport Enterprise Server on the backup server, and then log onto the JReport Administration page (port 8889 by default).
2. Click Configuration on the system toolbar, then click the Cluster tab.
3. Check the Backup Server option to indicate that this server will run as a backup server in the cluster.
4. In the Admin Server's RMI Host text field, type the RMI IP address or host name of the admin server.
5. In the Admin Server's RMI Port text field, type the RMI port number of the admin server.
6. In the Server's RMI Host text field, type the RMI IP address or host name of the local server.
7. In the Server's RMI Port text field, type the RMI port number of the local server.
8. Specify the paths of the shared directories on the shared disk (mapped network drive), such as shared properties directory, shared realm directory, shared resource root directory, shared temporary directory, and shared history directory. Make these settings consistent with those of the admin server.
9. Make sure that the backup server uses the same database as the admin server. If the system database of the backup server is different from the admin server's, after the backup server is promoted to be the admin server, the new admin server cannot retrieve data stored in the original admin server's system database.

   If you are using HSQLDB for JReport Enterprise Server's system database, click Data on the system toolbar, then in the URL text field, make the system database be in the shared properties directory as set in step 8.
10. Shut down JReport Enterprise Server on the backup server.

##### Using the server.properties and dbconfig.xml files

1. Launch JReport Enterprise Server once on the backup server, and then shut it down.
2. Open the server.properties file in `<install_root>\bin`.
3. Modify the properties file as follows:
   - cluster.admin.rmi.port=1129
     Specifies the admin RMI (remote method invocation) port. The default value is 1129.
   - server.rmi.port=1130
     Specifies the RMI port number of the local server.
   - cluster.server.admin=false
     Specifies whether the server is the admin server. The default value is true.
   - cluster.server.backup=true
     Specifies whether the server is a backup server. The default value is false.
   - loadbalance.type=(integer)
     Specifies the load-balancing algorithm type.

     This property only applies to the admin server. The reason why this property should be set for every backup server is that when the admin server is down, the promoted backup server will use its local load-balance type settings. This property will not take effect until this server is promoted to be the admin server. Make sure that the values for this property are identical on all backup servers.

4. Specify the paths of the shared directories on the shared disk (mapped network drive), such as shared properties directory, shared realm directory, shared resource root directory, shared temporary directory, and shared history directory.

   Add the following properties to the server.properties file:

   - resource.share.temp.dir=
     Specifies the directory for storing temporary files.
   - resource.share.hist.dir=
     Specifies the directory for storing all versions of report set results in the cluster.
   - resource.share.realm.dir=
     Specifies the directory of the realm files.
   - resource.share.properties.dir=
     Specifies the directory of the properties files.
   - resource.root=
     Specifies the directory of the JReport demo report sets.

     Make sure that these settings are consistent with those of the admin server.

5. Make sure that the backup server uses the same database as the admin server. If the system database of the backup server is different from the admin server's, after the backup server is promoted to be the admin server, the new admin server cannot retrieve data stored in the original admin server's system database.

   If you are using HSQLDB for JReport Enterprise Server's system database, edit dbconfig.xml in `<install_root>\bin` by making the system database be in the shared properties directory as set in step 4.

Notes:

- To make sure the backup server obtains report font information after it is promoted to be the admin server, set the font directory of the admin server and backup server on the shared disk (mapped network drive). There are two ways to set the font path:
  - Use the -D parameter to set the property jreport.server.font.path in the JReport Enterprise Server startup file.
  - Add and set the property server.font.path in the server.properties file.
- The shared directories must exist in the shared disk before the cluster can begin to function. If they do not exist, create or copy them from the JReport Enterprise Server home directory. They are properties, realm, jreports, temp, and history.

  If you choose to copy folders such as properties, realm, jreports, temp, and history from the JReport Enterprise Server home directory to the shared disk, you must first clear the content of the folders. Otherwise, the existing settings and information the folders contain will cause conflicts when JReport Enterprise Server is running.

- The folder names for the shared directories can be different from that of JReport Enterprise Server. However, you must make sure the paths you specify are consistent with that of the existing directories.
- If the content of the shared resource root directory jreports is removed, the Public Reports folder in the resource tree will be empty. When JReport Enterprise Server finds that there is no content in the properties folder, it will re-scan the resource directory to re-construct the properties folder's content.