Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
 
User Commandsconfigure-ha-persistence(1)


NAME

 asadmin configure-ha-persistence, configure-ha-persistence - enables configuration of parameters related to session persistence

SYNOPSIS

 configure-ha-persistence user admin_user [passwordfile filename] [host host_name] [port port_number] [secure|s] [terse=false] [echo=false] [interactive=true] [help] [type persistencetype] [frequency frequency] [scope scope] [store jdbc_resource_jndi_name] [property (name=value)[:name=value]*] [haagentport portnumber] [hosts hadb_hosts_list] clustername

DESCRIPTION

Configure the global session persistence settings to balance your needs for performance, reliability, and high availability. You can override these settings for specific applications by changing the properties of the manager-properties, store-properties, and session-properties subelements of the session-manager element in the sun-web.xml file.

The configure-ha-persistence command is available only in the Enterprise Edition of the Sun Java System Application Server.

OPTIONS

u user

The authorized domain application server administrative username.

w password

The password option is deprecated. Use passwordfile instead.

passwordfile

This option replaces the password option. Using the password option on the command line or through the environment is deprecated. The passwordfile option specifies the name of a file containing the password entries in a specified format. The entry for the password must have the AS_ADMIN_ prefix followed by the password name in capital letters. For example, to specify the domain application server password, use an entry with the following format: AS_ADMIN_PASSWORD=password, where password is the actual administrator password. Other passwords that can be specified include AS_ADMIN_MAPPEDPASSWORD, AS_ADMIN_USERPASSWORD, AS_ADMIN_SAVEDMASTERPASSWORD, AS_ADMIN_MQPASSWORD, AS_ADMIN_ALIASPASSWORD, and so on.

H host

The machine name where the domain application server is running. The default value is localhost.

p port

The port number of the domain application server listening for administration requests. The default port number for Enterprise Edition is 4849.

s secure

If set to true, uses SSL/TLS to communicate with the domain application server.

t terse

Indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well-formatted data for consumption by a script. Default is false.

e echo

Setting to true will echo the command line statement on the standard output. Default is false.

I interactive

If set to true (default), only the required password options are prompted.

h help

Displays the help text for the command.

type

Set the persistence type to specify where session data is stored. The persistence types available are:

  • memory If session persistence for the application server instance is disabled, this is the default persistence type. The memory persistence type provides no session persistence in a clustered environment. The memory persistence type is intended for development environments and should not be used for production.

  • file This type provides no session persistence in a clustered environment. Use file persistence type to store session data in a file. If the instance becomes unavailable and restarts, it can recover the session information that was last written to the file. The file persistence type is meant for development environments and should not be used for production.

  • ha If session persistence for the application server instance is enabled, this is the default persistence type. This type allows you to store session data in the HADB. The ha persistence type enables failover of ses sion information between application server instances in a cluster. The session information for each application server instance in a clus ter is stored in the HADB. The session information is available to all other instances in the cluster. If an instance in a cluster becomes unavailable, another instance in the cluster can continue to serve the sessions that the now unavailable instance was serving.

frequency

Set the persistence frequency to define the frequency at which the session state is stored in the HADB. The persistence frequencies available are:

  • web-method The session is stored after every web request just before a response is sent back to the client. Use this frequency when you need very high availability of updated session states.

  • time-based The session is stored at the time interval defined in the reapIntervalSeconds property. A better throughput is achieved because the session is stored after a configurable time interval instead of after every web request.

scope

Set the persistence scope to determine how much of the session is stored. The persistence scopes available are:

  • modified-session The entire session is stored only if it has been modified since the last time it was stored.

  • session The entire session is stored every time session information is saved to the HADB.

  • modified-attribute Only the modified attributes of the session are stored. Using this mode can improve the throughput and response time significantly for applications in which only a small portion of the session state is modified for any given request.

If you use the modified-attribute persistence scope, your application should follow these guidelines:

  • Call setAttribute() every time you modify the session state.

  • Make sure there are no cross-references between attributes. The object graph under each distinct attribute key is serialized and stored separately. If there are any object cross references between the objects under each separate key, they are not serialized and deserialized correctly.

  • Ideally, the session state should be stored in multiple attributes, or at least in a read-only attribute and a modifiable attribute.

store

Specify the JNDI name of the JDBC resource for the HADB. The default is jdbc/hastore.

property

You can configure other session persistence properties to fine tune the session persistence configuration. The following properties are available:

PropertyDefinition
reapIntervalSecondsSpecifies the number of seconds between checks for modified or timed-out sessions. This is also the frequency at which passivation of sessions occurs. If the persistence type is file or ha, sessions are passivated if maxSessions has been exceeded. If the persistence frequency is time-based, active sessions are stored at this interval. The default is 60.
maxSessionsSpecifies the maximum number of sessions that can be in the cache, or 1 for no limit. The default is 1.After this limit is reached: If the persistence type is memory, an attempt to create a new session causes an IllegalStateException to be thrown.If the persistence type is file or ha, the sessions are passivated to the persistent store.
sessionFilenameSpecifies the absolute or relative path to the file in which the session state is preserved between application restarts, if preserving the state is possible. A relative path is relative to the temporary work directory for this application. Applicable only if the persistence type is memory. By default, the session state is not preserved across server restarts.
directorySpecifies the absolute or relative path to the directory into which individual session files are written. A relative path is relative to the temporary work directory for this application. Applicable only if the persistence type is file. The default is instance_dir/generated/ jsp/j2ee-apps/ appname/appname_war.
timeoutSecondsSpecifies the default maximum inactive interval (in seconds) for sessions. If set to 0 or less, sessions never expire. If a session-timeout element is specified in the web.xml file, the session-timeout value overrides any timeoutSeconds value. If timeoutSeconds is specified in both sun-web.xml and domain.xml, the value in sun-web.xml takes precedence. If neither session-timeout nor timeoutSeconds is specified, the timeoutSeconds default is used. Note that the session-timeout element in web.xml is specified in minutes, not seconds. The default is 600.

haagentport

Specify the port number for the HADB node agent. The default is 1862.

hosts

Specify a comma-separated list of HADB host names.

OPERANDS

clustername

Specify the name of the cluster for which you are configuring session persistence.

EXAMPLES

Example 1. Using configure-ha-persistence
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

EXIT STATUS

0

command executed successfully

1

error in executing the command

SEE ALSO

configure-ha-cluster(1), remove-ha-cluster(1), create-ha-store(1), clear-ha-store(1)


J2EE SDK 1.4Go To TopLast Changed 31 Jan 2005