Sun GlassFish Enterprise Server v2.1.1 High Availability Administration Guide

Upgrading Incompatible Applications

If the new version of the application is incompatible with the old version, use the following procedure. For information on what makes applications compatible, see Application Compatibility. Also, you must upgrade incompatible application in two or more clusters. If you have only one cluster, create a “shadow cluster” for the upgrade, as described below.

When upgrading an incompatible application:

ProcedureTo Upgrade an Incompatible Application by Creating a Second Cluster

  1. Save an old version of the application or back up the domain.

    To back up the domain use the asadmin backup-domain command.

  2. Create a “shadow cluster” on the same or a different set of machines as the existing cluster. If you already have a second cluster, skip this step.

    1. Use the Admin Console to create the new cluster and reference the existing cluster’s named configuration.

      Customize the ports for the new instances on each machine to avoid conflict with existing active ports.

    2. For all resources associated with the cluster, add a resource reference to the newly created cluster using asadmin create-resource-ref.

    3. Create a reference to all other applications deployed to the cluster (except the current redeployed application) from the newly created cluster using asadmin create-application-ref.

    4. Configure the cluster to be highly available using asadmin configure-ha-cluster.

    5. Create reference to the newly-created cluster in the load balancer configuration file using asadmin create-http-lb-ref.

  3. Give the new version of application a different name from the old version.

  4. Deploy the new application with the new cluster as the target. Use a different context root or roots.

  5. Enable the deployed new application for the clusters using asadmin enable-http-lb-application.

  6. Start the new cluster while the other cluster is still running.

    The start causes the cluster to synchronize with the domain and be updated with the new application.

  7. Test the application on the new cluster to make sure it runs correctly.

  8. Disable the old cluster from the load balancer using asadmin disable-http-lb-server.

  9. Set a timeout for how long lingering sessions survive.

  10. Enable the new cluster from the load balancer using asadmin enable-http-lb-server.

  11. Export the load balancer configuration file using asadmin export-http-lb-config.

  12. Copy the exported configuration file to the web server instance’s configuration directory.

    For example, for Sun Java System Web Server, the location is web-server-install-dir/https-host-name/config/loadbalancer.xml. Dynamic reconfiguration must be enabled for the load balancer (by setting the reloadinterval in the load balancer configuration), so that the new load balancer configuration file is loaded automatically.

  13. After the timeout period expires or after all users of the old application have exited, stop the old cluster and delete the old application.