Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Application Server Standard and Enterprise Edition 7 2004Q2 Update 3 Administration Guide 

Appendix B
Failover Scenarios (Enterprise Edition)

The scenarios in this appendix illustrate how session persistence settings for application server instances and web applications affect the failover of session state and stateful session bean (SFSB) state in Sun Java System Application Server, Enterprise Edition. It also includes a discussion and sample failover scenario for Java Remote Method Invocation (RMI) and Internet Inter-Orb Protocol (IIOP) requests.

This appendix includes the following topics:


HTTP Session Failover

HTTP sessions can be failed over between server instances in a cluster. For information about setting up a cluster for failover, see Chapter 19, "Managing Clusters (Enterprise Edition)." For information about configuring session persistence, see Chapter 20, "Configuring Session Persistence (Enterprise Edition)."

This section contains the following topics:

Assumptions and Requirements

The following information about HTTP session persistence is relevant to the scenarios described in this appendix:

For more information on session persistence and the configuration settings related to session persistence, see Chapter 20, "Configuring Session Persistence (Enterprise Edition)."

Persistence Type Set to memory for Application Server Instances in Cluster

Summary

The persistence type for the application server instances in a cluster is set to memory and there are no persistence type settings defined for the web applications deployed in the cluster. If an application server instance on which HTTP sessions have been created becomes unavailable, the HTTP sessions created on it are not failed over to other application server instances.

Example

Here is an example of the scenario:

Result Description

These sessions will not be failed over to other application server instances in the cluster. If requests corresponding to these sessions come in, these requests will be routed to other (available) application server instances in the cluster as per the load balancing algorithm of the load balancer.

Persistence Type Set to memory for an Application Server Instance

Summary

In a development environment, the persistence type for an application server instance is set to memory and there are no persistence type settings defined for the web applications deployed on the instance.

The instance is gracefully shut down. When the instance restarts, it can recover HTTP session state from a file.

This mode is useful when you are using only one application server instance and there is no load balancer. However, in a clustered environment with a load balancer, by the time you have shut down the instance completely and then restarted it, the load balancer may have failed over the session state to other instances in the cluster and the instance may not be able to recover session state when it restarts.

Example

Here is an example of the scenario:

Result Description

Before the graceful shutdown, the instance stores the session state in a file in a directory. The path of the directory is the value of the sessionFilename property of session-manager in the server.xml file.

When you restart the instance, it will be able to get the session state from the file.

Persistence Type Set to file for an Application Server Instance

Summary

In a development environment, the persistence type for an application server instance is set to file and there are no persistence type settings defined for the web applications deployed on the instance.

The instance is gracefully shutdown or becomes unavailable. When the instance restarts, it can recover HTTP session state from a file.

This mode is useful when you are using only one application server instance and there is no load balancer. However, in a clustered environment with a load balancer, the session state cannot be recovered by any other instance in the cluster. Additionally, while the instance is unavailable, the load balancer may attempt to fail sessions over to other instances, and once the instance restarts, those sessions will have to be re-established (usually requiring the web client to reauthenticate).

Example

Here is an example of the scenario:

Result Description

While the application server instance is available, it stores the information for each session in a corresponding file. The session is stored at intervals specified by the reapIntervalSeconds property of the session manager element in the server.xml file.

If the instance restarts, it will be able to get the information for the sessions from the corresponding files. Because the session state is stored periodically (and not, for example, after every web method), there is a risk of some loss of session data, depending on when the session was last stored.

Persistence Type Set to ha for Application Server Instances in a Cluster

Summary

The persistence type for the application server instances in a cluster is set to ha and there are no persistence type settings defined for the web applications deployed in the cluster. If an application server instance on which sessions have been created becomes unavailable, the sessions created on it are failed over to other (available) application server instances in the cluster.

Example

Here is an example of the scenario:

Result Description

The instance that was originally serving the requests would have written the HTTP session state to the high-availability database (HADB).

The persistence frequency setting has a bearing on how up-to-date the HTTP session state information in the HADB is.

Persistence Type Set to memory for a Web Application

Summary

The persistence type for a web application deployed on a cluster is set to memory. If an application server instance on which sessions for this web application have been created becomes unavailable, the sessions created on it are not failed over to other application server instances in the cluster. This will happen regardless of the persistence type setting for the application server instances in the cluster.

Example

Here is an example of the scenario:

Result Description

The result is the same as in the case of Persistence Type Set to memory for Application Server Instances in Cluster.

Persistence Type Set to file for a Web Application

Summary

The persistence type for a web application deployed on a cluster is set to file. If an application server instance on which sessions for this web application have been created becomes unavailable, the sessions created on it are not failed over to other application server instances in the cluster. This will happen regardless of the persistence type setting for the application server instances in the cluster.

Example

Here is an example of the scenario:

Result Description

The result is the same as in the case of Persistence Type Set to file for an Application Server Instance.

Persistence Type Set to ha for a Web Application

Summary

The persistence type for a web application deployed on a cluster is set to ha. If an application server instance on which sessions for this web application have been created becomes unavailable, the sessions created on it are failed over to other application server instances in the cluster. This will happen regardless of the persistence type setting for the application server instances in the cluster.

Example

Here is an example of the scenario:

Result Description

The result is the same as in the case of Persistence Type Set to ha for Application Server Instances in a Cluster.


Stateful Session Bean Failover

The state of Stateful Session Beans (SFSBs) also fails over between server instances in a cluster. If the request for an SFSB comes in over the HTTP path, the stateful session bean state fails over between server instances in the HTTP cluster. If the request for an SFSB comes in over the RMI/IIOP path, the SFSB state fails over between the instances in an IIOP cluster.

This section contains the following topics:

Assumptions and Requirements

The following information about SFSB failover is relevant to the scenarios described in this appendix:

For more information on session persistence and the configuration settings related to session persistence, see Chapter 20, "Configuring Session Persistence (Enterprise Edition)."

SFSB State Stored in the File System

Summary

In a development environment, the persistence type for an application server instance is set to file or memory and the HADB is not configured.

The instance is gracefully shutdown or becomes unavailable. When the instance restarts, it can recover SFSB state from the file system.

This mode is useful when you are using only one application server instance and there is no load balancer. However, in a clustered environment with a load balancer, the SFSB state cannot be recovered by any other instance in the cluster.

Example

Here is an example of the scenario:

Result Description

While the application server instance is available, it stores information on SFSB state in the file system, at the location specified in the session-store attribute in the server.xml file. The SFSB state is stored at checkpoints, either at the end of a transaction in which the SFSB participates, or at the end of a business method invoked on the SFSB.

If the instance restarts, it will be able to get the information for the SFSB states from the file system.

SFSB State Stored in the HADB

Summary

The persistence type for the application server instances in a cluster is set to ha and the HADB is configured. Availability is enabled. If an application server instance on which sessions have been created becomes unavailable, the SFSB states on it are failed over to other (available) application server instances in the cluster.

Example

Here is an example of the scenario:

Result Description

The instance that was originally serving the requests would have written the SFSB state to the high-availability database (HADB). The SFSB state is stored at checkpoints, either at the end of a transaction in which the SFSB participates, or at the end of a business method invoked on the SFSB.

The application server instances to which the sessions are failed over access the SFSB state from the HADB.


Failover on RMI/IIOP Path

RMI/IIOP request failover provides high availability of RMI/IIOP references. These references can be either EJBs or NameService references. If the server instance that published an RMI/IIOP remote reference becomes unavailable, additional requests for the reference are failed over to an accessible instance in the cluster. In order for RMI/IIOP requests to fail over to another server instance, RMI/IIOP endpoints must be configured for the other server instances in the cluster. For more information on clusters, see Chapter 19, "Managing Clusters (Enterprise Edition)."

Once an IIOP request for an object is failed over to new server instance, all the subsequent requests to that IIOP object will continue to go to the same server instance even if the original server instance is back to life. Thus, the stickiness of objects to server instances is maintained even after failover.

This section contains the following topics:

Assumptions and Requirements

The following information about RMI/IIOP failover is relevant to the scenario described in this appendix:

RMI/IIOP Failover Scenario

Summary

A client requests a remote reference from the server instance in a cluster which has IIOP endpoints configured. The load balancer sends the request to a particular server instance. The instance is gracefully shut down or becomes unavailable.

Example

Here is an example of the scenario:

Result Description

The request for the remote EJB is failed over to another server instance in the IIOP cluster.

If the request is for an SFSB, the state stored in the HADB fails over as well.



Previous      Contents      Index      Next     


Copyright 2005 Sun Microsystems, Inc. All rights reserved.