Configure persistent session management

WAS V5.1 supports persistent session management in two ways: Database session persistence, where sessions are stored in a defined database. This mechanism was already implemented in WAS V4.0. Memory-to-memory (or in-memory) session replication, where sessions are stored in one or more appserver instances.

For more information about distributed session management, see Session persistence considerations. Or refer to Chapter 14 (Configuring session management), especially Section 14.9, "Persistent session management" of the redbook IBM WebSphere Version 5.0 System Management and Configuration SG24-6195-00.

For our sample topology, we decided to use memory-to-memory replication. The following section will show you how to configure this function.

When creating our WEBcluster, we also created a replication domain. See 7.5.2, Creating the Web container cluster for details. Thus, the first thing to do is to verify that the replication domain has been set up:

1. Log on to the WebSphere Administrative Console and select Environment -> Internal Replication Domains. You should see the replication domain WEBcluster here (associated with the cluster WEBcluster).

2. Click the WEBcluster replication domain. Scroll down and select Replicator Entries (listed under Additional Properties). There should be a replicator entry for each appserver member within the WEBcluster as shown in Figure 7-27.

Figure 7-27 Replicator entries for Internal Replication Domain WEBcluster

The following instructions need to be repeated for each appserver in the WEBcluster (WEB1a, WEB1b, and WEB2):

1. Using the WebSphere Administrative Console, select Servers -> Application Servers and select the first appserver (WEB1a) from the right pane.

2. Scroll down to Additional Properties and select Web Container.

3. On the next window, in the Additional Properties section, click Session Management.

4. Again, scroll down to the Additional Properties and select Distributed Environment Settings. The window shown in Figure 7-28 is displayed.

Figure 7-28 Select Memory-to-Memory Replication

5. Check the Memory-to-Memory Replication radio button and click Apply.

6. Now click the Memory-to-Memory Replication link itself to display the Internal Messaging configuration window shown in Figure 7-29.

7. Select the WEBcluster replicator from the drop-down and ensure the Runtime mode is set to Both client and server. Click Apply to use this configuration.

Figure 7-29 Configuring memory-to-memory session replication

8. Click the Distributed Environment Settings link on the top right of the window and select Custom Tuning Parameters (under Additional Properties).

9. Select Low (optimize for failover) for the Tuning level and click Apply as detailed in Figure 7-30. This will ensure an update of all session data of a particular session before the servlet engine finishes its request.

Figure 7-30 Tune the persistent Session Manager

10. Click Save to save the changes to the master configuration.

11. Perform step 1 to step 10 for each appserver within the cluster.

Important: In a cluster, by default, sessions are replicated to all servers in the cluster that are connected to the same replicator domain. This replication can be redundant if there is a large number of servers in a cluster. The Session Management facility has an option to partition the servers into groups when storing sessions. There is also an option to replicate the session to only one other server (the Single Replica option in the Internal Replication Domains configuration). When this option is chosen, one single server in the replication domain is selected during session creation, and all updates to the session are only replicated to that single server.

The option we have chosen - each appserver holds all session data - should be regarded as the most robust one. However, performance could be affected by this. Thus, in a production environment, consider other options as well.

12. Start the newly created clusters via Servers -> Clusters. Check both clusters and click the Start button. Use the Refresh icon to verify the status.

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.