Sun ONE logo      Previous      Contents      Index      Next     

Sun ONE Application Server 7, Enterprise Edition Administrator's Guide

Appendix B
Failover Scenarios

The scenarios in this appendix illustrate how session persistence settings for application server instances and web applications affect the failover of session state in SunTM Open Net Environment (Sun ONE) Application Server 7, Enterprise Edition.

This appendix includes the following topics:


Assumptions and Requirements

The following information about 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 18, "Configuring Session Persistence."


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 sessions have been created becomes unavailable, the 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 shutdown. When the instance restarts, it can recover 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 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 session state to the high-availability database (HADB).

If the persistence frequency for this application server instance is set to time-based, the session state is stored periodically at the time interval specified in the reapIntervalSeconds property of the manager-properties element in the server.xml file (for instance-level configuration) or in the sun-web.xml file (for application-level configuration). For more information, see "Configuring Other Session Persistence Properties".

If the persistence frequency for the application server instance is set to web-method, the session state is stored after every web request.

Thus, the persistence frequency setting has a bearing on how up to date is the session state in the HADB at any time.

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


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".



Previous      Contents      Index      Next     


Copyright 2003 Sun Microsystems, Inc. All rights reserved.