Sun GlassFish Enterprise Server 2.1 High Availability Administration Guide

Configuring Availability for the Web Container


Note –

The HADB software is supplied with the Enterprise Server standalone distribution of Sun GlassFish Enterprise Server. For information about available distributions of Sun GlassFish Enterprise Server, see Distribution Types and Their Components in Sun GlassFish Enterprise Server 2.1 Installation Guide. HADB features are available only in the enterprise profile. For information about profiles, see Usage Profiles in Sun GlassFish Enterprise Server 2.1 Administration Guide.


If you are using HADB, enable and configure web container availability by using the asadmin configure-ha-persistence. For more information about this command, see configure-ha-persistence(1).

Alternatively, use the asadmin set command to set the configuration’s availability-service.web-container-availability.availability-enabled property to true and then configure-ha-persistence to set properties as desired.


Note –

If you are using in-memory replication to store session state data, you must use the asadmin set command to enable web container availability and to set properties. You can use the configure-ha-persistence command only with HADB.


For example, use the set command as follows, where config1 is the configuration name:


asadmin set 
config1.availability-service.web-container-availability.availability-enabled="true"

asadmin set 
config1.availability-service.web-container-availability.persistence-frequency="time-based"

Or use the set and configure-ha-persistence commands as follows, where config1 is the configuration name:


asadmin set 
config1.availability-service.web-container-availability.availability-enabled="true"
asadmin configure-ha-persistence --user admin --passwordfile secret.txt 
--type ha 
--frequency web-method 
--scope modified-session 
--store jdbc/hastore 
--property maxSessions=1000:reapIntervalSeconds=60 cluster1

ProcedureTo Enable Availability for the Web Container with Admin Console

  1. In the tree component, select the desired configuration.

  2. Click on Availability Service.

  3. Select the Web Container Availability tab.

    Check the Availability Service box to enable availability. To disable it, uncheck the box.

  4. Change other settings, as described in the following section, Web Container Availability Settings

  5. Restart the server instance.

Web Container Availability Settings


Note –

The HADB software is supplied with the Enterprise Server standalone distribution of Sun GlassFish Enterprise Server. For information about available distributions of Sun GlassFish Enterprise Server, see Distribution Types and Their Components in Sun GlassFish Enterprise Server 2.1 Installation Guide. HADB features are available only in the enterprise profile. For information about profiles, see Usage Profiles in Sun GlassFish Enterprise Server 2.1 Administration Guide.


The Web Container Availability tab of the Availability Service enables you to change these availability settings:

Persistence Type: Specifies the session persistence mechanism for web applications that have availability enabled. Allowed values are memory (no persistence) file (the file system), ha (HADB), and replicated (memory on other servers).

HADB must be configured and enabled before you can use ha session persistence. For configuration details, see configure-ha-cluster(1).

If web container availability is enabled, the default persistence type depends on the profile, as shown in the following table.

Profile 

Persistence Type 

Developer 

memory

Cluster 

replicated

Enterprise 

ha

For production environments that require session persistence, use ha or replicated. The memory persistence type and the file persistence type do not provide high availability session persistence.

If web container availability is disabled, the default persistence type memory.

Persistence Frequency: Specifies how often the session state is stored. Applicable only if the Persistence Type is ha or replicated. Allowed values are:

Persistence Scope : Specifies how much of the session object and how often session state is stored. Applicable only if the Persistence Type is ha or replicated. Allowed values are as follows:

Single Sign-On State: Check this box to enable persistence of the single sign-on state. To disable it, uncheck the box. For more information, see Using Single Sign-on with Session Failover

HTTP Session Store: You can change the HTTP Session Store if you changed the JDBC resource used for connections to the HADB for session persistence. For details, see configure-ha-cluster(1).