Creating and Deploying to WebLogic Server Clusters

Tutorial 4: Deploying the MedRec Package to a Cluster

This tutorial describes how to deploy the MedRec applications to a cluster for production. The tutorial includes the following sections:

- Prerequisites

- Procedure

- Best Practices

- The Big Picture

- Related Reading

Prerequisites

Before starting this tutorial:

- Use the Configuration Wizard to create the clustered servers as described in Tutorial 1: Creating a WebLogic Server Cluster.

- Use the Administration Console to create and target MedRec application resources, as described in Tutorial 3: Setting Up Cluster Resources for MedRec.

Procedure

Now that your running cluster has the JDBC, JMS, and Mail resources required by the MedRec applications, you can deploy MedRec to the cluster.

- Step 1: Deploy the MedRec Application

- Step 2: Deploy the Physician Application

- Step 3: Test the Deployment

Step 1: Deploy the MedRec Application

1. Expand the Deployments node in the left pane of the console.

2. Right-click Applications and select Deploy a new Application.

3. In the right pane, use the links in the Location field to navigate to the c:\bea\weblogic81\samples\server\medrec\dist directory. After selecting this directory, the deployment assistant lists three MedRec applications as being available:

   - medrecEar

   - physicianEar

   - startupEar

   Note: The startupEar application is used to automatically start a browser and load the MedRec index page when you start a single-server MedRec domain. It is not intended for deployment to a cluster.

4. Select the medrecEar application.

5. Click Target Application.

6. In the Select targets for this application screen:

   - Select medreccluster from the list of clusters.

   - Ensure that the All servers in the cluster option is selected.

   - Click Continue.

7. On the Review your choices and deploy page:

   - Select the "I will make the application accessible from the following location" option.

   - Click the Deploy button.

8. Monitor the deployment status for all components of medrecEar. When all modules have deployed, continue with the next step.

Step 2: Deploy the Physician Application

1. Expand the Deployments node in the left pane of the console.

2. Right-click Applications and select Deploy a new Application.

3. In the right pane, use the links in the Location field to navigate to the c:\bea\weblogic81\samples\server\medrec\dist directory. After selecting this directory, the deployment assistant lists three MedRec applications as being available:

   - medrecEar

   - physicianEar

   - startupEar

   Note: The startupEar application is used to automatically start a browser and load the MedRec index page when you start a single-server MedRec domain. It is not intended for deployment to a cluster.

4. Select the physicianEar application.

5. Click Target Application.

6. In the Select targets for this application screen:

   - Select medreccluster from the list of clusters.

   - Ensure that the All servers in the cluster option is selected.

   - Click Continue.

7. On the Review your choices and deploy page:

   - Select the "I will make the application accessible from the following location" option.

   - Click the Deploy button.

8. Monitor the deployment status for all components of medrecEar. When all modules have deployed, continue with the next step.

Step 3: Test the Deployment

To test whether the deployment was successful, open a browser window and enter the URL:

>     http://127.0.0.1:8001/start.jsp

You should receive the main login page where you can use the application from different roles.

Try accessing the same application using other server's in the cluster by entering the URLs:

>     http://127.0.0.1:8011/start.jsp

>     http://127.0.0.1:8021/start.jsp

Each URL should provide the main login page.

Best Practices

Deploy applications to all members of the cluster (homogeneous deployment) to avoid JNDI conflicts. See Communications in a Cluster in Using WebLogic Server Clusters.

The Big Picture

In this tutorial, you specify the different port numbers in separate URL requests to access different members of the cluster. A more sophisticated development environment might use a single DNS name that maps to all addresses in the cluster. DNS cycles through the configured addresses in a round-robin fashion to distribute multiple requests to different IP addresses.

Production environments generally use load balancing hardware with sophisticated load algorithms and load monitoring to ensure that large volumes of requests are distributed network requests to servers evenly (or according to each machine's processing capacity).

Related Reading

- WebLogic Server Application Packaging

- Deploying Applications and Modules

- Load Balancing in a Cluster in Using WebLogic Server Clusters