Sun Java System Reference Configuration Series: Portal Service on Application Server Cluster

ProcedureTo Verify Portlet Session Failover

In this procedure, you exercise the Session Counter portlet by successively reloading the developer desktop page in a browser. You first exercise the portlet while the Portal Server instance on ps2 is shut down, noting the session counter value. You then restart the Portal Server instance on ps2 and simulate a failure of the Portal Server instance on ps1so that the portal service fails over to the instance on ps2.

You then continue to refresh the browser and note the session counter value. If portlet session failover is working properly, the session counter value should continue to increase from its value before the failover occurred. If the session counter value is reset to 1, then session failover is not working.

  1. Make sure that ps-inst-ps1 on ps1 is running and that ps-inst-ps2 on ps2 is shut down.

    1. Start ps-inst-ps1 by starting the Application Server instance on ps1 in which it is deployed.

      # /opt/SUNWappserver/sbin/asadmin start-instance --user admin as-cluster-inst-ps1

      When prompted, type the app-server-admin-password.

    2. Shut down ps-inst-ps2 by shutting down the Application Server instance on ps2 in which it is deployed.

      # /opt/SUNWappserver/sbin/asadmin stop-instance --user admin as-cluster-inst-ps2

      When prompted, type the app-server-admin-password.

  2. Create a portlet session on ps1.

    You create a session by accessing the Session Counter portlet on the Developer Sample desktop, as follows:

    1. Open the portal service in a browser:

      http://ps.pstest.com/portal

    2. On the Samples box, click on the DeveloperSample.

      The anonymous desktop for the DeveloperSample should be displayed.

    3. Log in by typing the following values and clicking Login.

      Input Field 

      Value 

      User ID 

      developer 

      Password 

      developer 

      The DeveloperSample desktop is displayed.

    4. Click the Portlet Samples tab.

    5. Look at the Session Counter channel.

      The channel should show (in addition to other information):

      Counter Value in Session is 1.

  3. Click Reload in your browser.

    Now the Session Counter channel should show:

    Counter Value in Session is 2.

    Every time you reload the desktop page, the counter value will increase.

  4. Start ps-inst-ps2.

    # /opt/SUNWappserver/sbin/asadmin start-instance --user admin as-cluster-inst-ps2

  5. Simulate a failure of ps-inst-ps1.

    In the configuration interface for your load balancer (ps.pstest.com), remove the real server instance, ps-inst-ps1, from the service group.

  6. Click Reload in your browser.

    Now the Session Counter channel should show:

    Counter Value in Session is N.

    Where the value of N is one integer greater than the last value in Step 3.

    If session failover is not working, then the channel would show:

    Counter Value in Session is 1.

  7. Recover the simulated failure of the ps-inst-ps1 instance.

    Return to the configuration interface for your load balancer, and re-enable the instance.