### Failover

#### Failure detection

To maintain the state of a JReport Enterprise Server cluster, each member server sends its heart beat to the admin server periodically, and then the admin server checks and responds to those heart beats. If a member server's heart beat cannot be received for a certain period of time, which depends on two properties' values - cluster.heart_beat.interval and cluster.heart_beat.max_retries, the admin server will remove it from the active clustered server list. Likewise, if a member server's heart beat signal to the admin server fails for a certain period of time, the admin server is judged as failed.

#### Admin server failure

In a cluster, each backup server possesses a unique priority value. If the admin server fails to work, the one that has the highest priority among the active backup servers will promote itself to be the new admin server, and will take over all administrative tasks in the cluster. All tasks running previously on the admin server will be reallocated to the other servers.

When the previous admin server recovers, it will join the cluster automatically either as a backup server or as a slave server, depending on your settings:

- As a backup server when the following properties have been specified in server.properties in the `<install_root>\bin` directory and when the specified paths exist:

  `resource.root
  resource.share.hist.dir
  resource.share.properties.dir
  resource.share.realm.dir`

- As a slave server when the above properties have not been specified or the specified paths do not exist.

The priority value set to a backup server must be a non-negative integer. 0 represents the highest priority.

#### Member server failure

Effect on load balancing

When the admin server detects a failed member server, it will remove the member server from the active server list and will not schedule reporting tasks to that server any more. Load balancing will proceed on the remaining active servers.

Effect on incompleted tasks

When the admin server detects a failed clustered server, it will check the shared table for the list of incompleted tasks and will then reassign all incompleted tasks to other active servers using the load balancer.

Effect on completed tasks

JReport supports only report set lever recovery but not session level recovery. Once a report task is completed, it will be written to a temporary storage for redirection to the requester. Failure after that will not be recovered.

#### Notifying of server down

If you have enabled the notifying of server down feature, when a member server crashes or is disconnected with the admin server, the admin server will send a notification e-mail to a specified address. If the admin server crashes, a backup server will promote itself to be the new admin server and send a notification e-mail instead.