OracleAS 10.1.3 Cluster, Online Configuration Changes and Rolling Upgrades

Purpose

The goal of this tutorial is to show you how to use OC4J clusters. Along with other features, the new OC4J cluster framework allows:

  • Dynamic discovery of instances
  • Dynamic routing of requests
  • Maximum performance and reliability in session replication
  • Sequential deployment for stateful rolling upgrades

Time to Complete

Approximately 45 minutes

Topics

This tutorial covers the following topics:

 Overview
 Prerequisites
 Verifying the Status of Your Instances

Configuring Dynamic Node Discovery

 Deploying the Application to One of Your Instances
 Accessing the Application in the Other Instance
 Verifying That No Down Time Is Experienced
 Configuring the Two Instances to Replicate State Through Multicast Protocol

Testing Failover of a Session

 Perform a stateful rolling upgrade
 Summary
 Related Information

Viewing Screenshots

 Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, and, depending on your Internet connection, may result in a slow response time.)

Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.

Overview

This tutorial covers how to implement auto discovery and dynamic routing. When a J2EE application is deployed to an Oracle Application Server instance, the application is discovered by OPMN and the load-balancing mount points with the appropriate mod_OC4Js are automatically registered. This eliminates the need to manually configure these mount points within mod_OC4J. This also eliminates the need to restart Oracle HTTP Server each time a new application is deployed, thus simplifying configuration and reducing down time.

Back to Topic List

 

Prerequisites

Before starting this tutorial, you should:

1.

Download and install JDK 1.4

2. Install two Oracle Application Server 10g (10.1.3) instances on a machine.
3.

Create a directory called files on the machine hosting Oracle Application Server. Download and extract the contents of OC4JCluster.zip to the files directory. The files directory should now contain the following files:
rolling_aussie.ear
rolling_spanish.ear
rollingweb.ear
state.ear
newhttpclient.jar
runhttpclient.bat
test.properties
Readme.txt

Back to Topic List

Verifying the Status of Your Instances

Verify that the two Oracle Application Server instances are available.

1.

Open a browser window and enter the following URL to access Oracle Application Server Control of the first instance:

http://<hostname>.<domain>:7777/em

 

2.

Enter oc4jadmin in the User Name field and enter the password ( welcome1) in the Password field. Click Login.

 

3.

Verify the nodes listed under the Members region.

 

4.

Open another browser window and enter the following URL to access Oracle Application Server Control of the second instance:

http://<hostname>.<domain>:7778/em

 

5.

Enter oc4jadmin in the User Name field and enter the password ( welcome2) in the Password field. Click Login.

 

6.

Verify the nodes listed under Members region.

 

7.

Obtain information on the Oracle Application Server processes managed by OPMN on the first instance with the following command:

ORACLE_HOME\opmn\bin>opmnctl status

 

8.

Obtain information on the Oracle Application Server processes managed by OPMN on the second instance with the following command:

ORACLE_HOME\opmn\bin>opmnctl status

 

Back to Topic List

Configuring Dynamic Node Discovery

Multicast discovery is a basic cluster configuration, in which each Oracle Notification Server (ONS) node broadcasts a simple multicast message announcing its presence, thereby enabling nodes within the cluster to dynamically "discover" one another. In this model, each ONS maintains its own map of the cluster topology. When a new ONS is added to the cluster, each existing ONS adds the new node and its connection information to its map. At the same time, the new ONS adds all of the existing nodes to its map. Alternately, when an ONS is removed from the cluster, the maps for the remaining nodes are updated with this change.
The dynamic discovery configuration is set within a <discover> subelement of the <topology> element in the opmn.xml file on each Oracle Application Server instance in the topology. Dynamic nodes can also be configured with opmnctl. 10.1.3 opmnctl supports a new config topology command that allows you to specify, update, or delete the multicast <discovery> entry within this file. The update command inserts or updates the <discover> element with the specified value. It has the following syntax:

opmnctl config topology update discover=*<multicastAddress>:<multicastPort>

To update the opmn.xml file in your two instances to use the same discovery address, perform the following steps:

1.

Update the opmn.xml file in your first instance as follows:

opmnctl config topology update discover=*225.0.0.20:8001
opmnctl reload

 

2.

Update the opmn.xml file in your second instance as follows:

opmnctl config topology update discover=*225.0.0.20:8001
opmnctl reload

 

3.

Using Application Server Control, verify that the two nodes are in the same cluster :

http://<hostname>.<domain>:7777/em

Verify that the nodes are listed under the Cluster Topology.

 

4.

Using opmnctl, verify that your nodes are in the same cluster:

ORACLE_HOME\opmn\bin>opmnctl @cluster status

 

Back to Topic List

Deploying the Application to One of Your Instances

In Oracle Application Server 10.1.3, the mount point is dynamically updated as new nodes and applications are added to or removed from the cluster. This dynamic discovery mechanism is enabled by default and requires no additional configuration. The state.ear application is available in the files directory. Deploy the EARfile through Oracle Application Server Control.

1.

Open your browser and enter the following URL:

http://<hostname>.<domain>:7777/em

Click the home link in the Cluster Topology page.

 

3.

The OC4J: home component page opens with the Home page link that provides status and performance information for this OC4J component. Use the Applications page link to view and manage the J2EE applications that have been deployed to the container, and information on their usage and performance. Click the Applications page link to display the applications for the home instance.

 

2.

Click Deploy to launch the Deploy Application Wizard.


3.

On the Deploy: Select Archive page, click Browse to select the state.ear file from the files directory as the EAR file to deploy. Click Next.

 

5.

On the Deploy: Application Attributes page, enter state in the Application Name field. Click Next.

 

6.

Click Deploy on the Deploy: Deployment Settings page.

 

7.

The application has been successfully deployed. Click Return on the Confirmation page.

 

8.

After the application has been deployed, Application Server Control returns you to the Applications property page of the OC4J home instance. Note that the application appears in the list of deployed applications.

 

9.

After the deployment has completed, verify the contents in the mod_oc4j.conf file in the other instance under ORACLE_HOME\Apache\Apache\conf\mod_oc4j.conf. The file should be practically empty.

 

Back to Topic List

Accessing the Application from the Oracle HTTP Server located in the Other Instance

1.

Open a new browser window and enter the following URL to access the application through Oracle HTTP Server in the instance where the application is not deployed:

http://<hostname>.<domain>:7778/ha

Dynamic routing should work and you should see your application.

 

Back to Topic List

Verifying That No Down Time Is Experienced

httpclient is a simple load generator Java application. Use the httpclient application to continuously access the application that you deployed earlier.

1.

Run the HTTP client by executing runhttpclient.bat from files directory to continuously access the application deployed in the earlier step.
Double-click runhttpclient.bat file to open the HTTP load tester interface. Enter the following information:

Host: Host name or IP address to access
Port: 7778 ( Port number of of the Application Server Control instance where the application is not deployed)
Number of requests: 500
Web Resource: /ha/HAServlet (This is the page or URL in the Web site that will be used in the request.)
Inter-request sleep: 40 (Time to wait in between two generated requests)
Plot results graphic should be selected.

Click Start Test.

 

2.

Observe the response time for each request in a new Graph window.

 

3.

After the progress indicator in the HTTP load tester window shows 100%, click Show Results Table.

 

4.

Observe the results in the Results window. HTTP Reply Code shows 200, indicating that all the requests have succeeded with no error replies. Click Close.

 

5.

Deploy the state.ear application to the second instance of your cluster. Open your browser and enter the following URL:

http://<hostname>.<domain>:7778/em

If required, enter the username and password. Click home link.

In the Cluster Topology page, click the home link. The OC4J: home component page opens with the Home page link that provides status and performance information for this OC4J component.

Click the Applications page link to display the applications for the home instance.

 

6.

Click Deploy to launch the Deploy Application Wizard.

 

7.

On the Deploy: Select Archive page, click Browse and select the state.ear file from the files directory as the EAR file to deploy. Click Next.

 

8.

Wait while uploading is in progress.

 

9.

On the Deploy: Application Attributes page, enter state in the Application Name field. Click Next.

 

10.

Click Deploy on the Deploy: Deployment Settings page.

 

11.

The application has been successfully deployed. Click Return on the Confirmation page.

 

12.

Click Start Test in the HTTP load tester window.

 

13.

You may experience an impact in performance but should get no failed requests from the client application. Click Show Results Table to verify this.

 

14.

Access the URL: http://<hostname>.<domain>:7777/ha/HAServlet.
Enter a value in the Name and Last Name field. Click Update.

 

15.

Deploy a new application to the first instance of your cluster. Open your browser and enter the following URL:

http://<hostname>.<domain>:7777/em

Enter the username and password, and click Login, if required.

In the Cluster Topology page, click the home link. The OC4J: home component page opens with the Home page link that provides status and performance information for this OC4J component. Click the Applications page link to display the applications for the home instance.

 

16.

Click Deploy to launch the Deploy Application Wizard.

 

17.

On the Deploy: Select Archive page, click Browse and select the rollingweb.ear file from the files directory as the EAR file to deploy. Click Next.

 

18.

Wait while uploading is in progress.

 

19.

On the Deploy: Application Attributes page, enter rollingweb in the Application Name field. Click Next.

 

20.

Click Deploy on the Deploy: Deployment Settings page.

 

21.

The application has been successfully deployed. Click Return on the Confirmation page.

 

22.

Deploy a new application to the second instance of your cluster. Open your browser and enter the following URL:

http://<hostname>.<domain>:7778/em

Enter the username and password, and click Login, if required.

In the Cluster Topology page, click the home link. The OC4J: home component page opens with the Home page link that provides status and performance information for this OC4J component. Click the Applications page link to display the applications for the home instance.

 

23.

Click Deploy to launch the Deploy Application Wizard.

 

24.

On the Deploy: Select Archive page, click Browse and select the rollingweb.ear file from the files directory as the EAR file to deploy. Click Next.

 

25.

Wait while uploading is in progress.

 

26.

On the Deploy: Application Attributes page, enter RollingWebInstance2 in the Application Name field. Click Next.

 

27.

Click Deploy on the Deploy: Deployment Settings page.

 

28.

The application has been successfully deployed. Click Return on the Confirmation page.

 

29.

Run the HTTP client by executing runhttpclient.bat from files directory to continuously access the application that you deployed in the earlier step.
Double-click the runhttpclient.bat file to open the HTTP load tester interface. Enter the following information:

Host: Host name or IP address to access
Port: 7778 (Port number of of the Application Server Control instance where the application is not deployed)
Number of requests: 500
Web Resource: /ha/HAServlet (This is the page or URL in the Web site that will be used in the request)
Inter-request sleep: 40 (Time to wait in between two generated requests)
Plot results graphic should be selected

Click Start Test.

 

30.

Observe the response time for each request in a new Graph window.

 

31.

After the progress indicator in the HTTP load tester window shows 100%, click Show Results Table.

 

32.

Observe the results in the Results window. HTTP Reply Code shows 200, indicating that all the requests have succeeded with no error replies. Click Close.

 

Back to Topic List

Configuring the Two Instances to Replicate State Through Multicast Protocol

The notion of islands, part of the clustering framework in previous OC4J releases, is no longer supported in OC4J. In OC4J 10g (10.1.3), you can effectively limit the number of instances to replicate data to, using the write-quota attribute of the <cluster> element. This makes it possible to control the scope of state replication .

1.

You can enable Multicast replication through Oracle Application Server Control.

Access the browser and enter the following URL:

http://<hostname>.<domain>:7777/em

Enter the username and password, and click Login, if required.

In the Cluster Topology page, click the home link. The OC4J: home component page opens with the Home page link that provides status and performance information for this OC4J component. Click the Applications page link to display the applications for the home instance.

 

2.

Click the state application link to navigate to the applications page.

 

3.

Click Redeploy.

 

4.

Click Browse next to the Archive Location field, and select the state.ear file from files directory. Select Automatically create a new deployment plan from Deployment Plan region. Click Next.

 

5.

Click Next on Redeploy: Application Attributes page.

 

6.

Click the Go To Task icon next to Configure Clustering.

 

7.

Select Override parent application clustering settings. Select Enable from the Clustering list. Select Multicast IP Replication. Enter 230.230.0.XXX (Please replace XXX with the last three digits of the client machine's IP Address) in the Multicast IP Address field and 45566 in the Multicast Port field. Click OK.

 

8.

Verify that the deployment plan has been updated successfully. Click Redeploy.

 

9.

Click Return.

 

10.

Navigate to ORACLE_HOME\\j2ee\home\application-deployments\state in the first instance. Open the orion-application.xml file and verify that the <cluster> element entry has been added.

 

11.

Access the browser and enter the following URL:

http://<hostname>.<domain>:7778/em

Enter the username and password, and click Login, if required.

In the Cluster Topology page, click the home link. The OC4J: home component page opens with the Home page link that provides status and performance information for this OC4J component. Click the Applications page link to display the applications for the home instance.

 

12.

Click the state application link to navigate to the applications page.

 

13.

Click Redeploy.

 

14.

Click Browse next to the Archive Location field and select the state.ear file from files directory. Select Automatically create a new deployment plan from Deployment Plan region. Click Next.

 

15.

Click Next on the Redeploy: Application Attributes page.

 

16.

Click the Go To Task icon next to Configure Clustering.

 

17.

Select Override parent application clustering settings. Select Enable from the Clustering list. Select Multicast IP Replication. Enter 230.230.0.XXX (Please replace XXX with the last three digits of the client machine's IP Address) in the Multicast IP Address field and 45566 in the Multicast Port field. Click OK.

 

18.

Verify that the deployment plan has been updated successfully. Click Redeploy.

 

19.

Click Return.

 

20.

Navigate to ORACLE_HOME\\j2ee\home\application-deployments\state in the first instance. Open orion-application.xml file and verify that the <cluster> element entry has been added.

 

Back to Topic List

Testing Failover of a Session

Test failover of a session by accessing the "state" application and placing some state in it. Shut down the instance being used in the requests. Stop the Oracle HTTP Server on the first instance, place some state in the application, and stop the local OC4J instance. The request should be routed by Oracle HTTP Server to the other OC4J maintaining state.

1.

Access the application from the following URL:

http://<hostname>.<domain>:7778/ha/HAServlet

Enter a value in the Name and Last Name fields. Click Update.

 

2.

Stop Oracle HTTP Server on the first instance using the following command:

ORACLE_HOME\opmn\bin>opmnctl stopproc process-type=HTTP_Server

 

3.

Access the application and place some state in the application.

 

4.

Stop OC4J on the first instance using the following command:

ORACLE_HOME\opmn\bin>opmnctl stopproc process-type=home

 

5.

Access the application and place some state in the application. The request should be routed by Oracle HTTP Server to the other OC4J maintaining state.

 

6.

Start OC4J on the first instance with the following command:

ORACLE_HOME\opmn\bin>opmnctl startproc process-type=home

 

7.

Stop OC4J on the second instance with the following command:

ORACLE_HOME\opmn\bin>opmnctl stopproc process-type=home

 

8.

Access the application and place some state in the application. The request should be routed by Oracle HTTP Server to the other OC4J maintaining state.

 

9.

Start OC4J on the second instance with the following command:

ORACLE_HOME\opmn\bin>opmnctl startproc process-type=home

 

Back to Topic List

Perform a stateful rolling upgrade

Oracle Application Server 10.1.3 has introduced new features that give a better control over the deployment process in a cluster. In some configurations, it may be desired to perform a re-deployment in parallel to all the instances in a cluster (for performance reasons, for example). In these situations you want to re-deploy the application as fast as possible. In other situations, it may be desired to deploy sequentially in order to preserve the state of the different applications. By deploying to one instance at a time in a cluster, we provide the other instances the time lapse to inherit the state present in those JVMs that are suffering a redeployment. This way a redeployment can take place preserving, for example, the HTTPSessions present in the cluster. The sequential deployment option is available with the admin_client.jar tool provided with OC4J. The purpose of this final part of the OBE is to verify that we can perform the redeployment of an application while maintaining the sessions.

1.

Set the PATH environment variable to point to JDK\bin directory.

set PATH=E:\j2sdk1.4.1_03\bin

 

2.

Execute the following command from the <ORACLE_HOME>/j2ee/home directory to observe the deployment options.

java -jar admin_client.jar

 

3.

Redeploy to your cluster using the following command:

java -jar admin_client.jar deployer:cluster:opmn://any_cluster-node:opmn_request_port/home oc4jadmin oc4jadmin_password -redeploy -file rolling_aussie.ear -deploymentName name_of_stateful _app -sequential -keepsettings

For example,

java -jar admin_client.jar deployer:cluster:opmn://dhcp-lexington-152-69-150-156:6003/home oc4jadmin welcome1 -redeploy -file E:\files\rolling_aussie.ear -deploymentName rollingweb -sequential -keepsettings

The opmn_request port is listed in opmn.xml under "request". The name_of_stateful_app must match the previously deployed stateful application.

 

4.

You can test the stateful rolling upgrade by accessing the application with the browser and placing some state on it while the deployment takes place.

 

5. You can also use the http client to generate some stateful load.

Run the HTTP client by executing runhttpclient.bat from files directory to continuously access the application that you deployed in the earlier step.
Double-click the runhttpclient.bat file to open the HTTP load tester interface. Enter the following information:

Host: Host name or IP address to access
Port: 7778 (Port number of of the Application Server Control instance where the application is not deployed)
Number of requests: 500
Web Resource: /ha/HAServlet (This is the page or URL in the Web site that will be used in the request)
Inter-request sleep: 40 (Time to wait in between two generated requests)
Plot results graphic should be selected
Stateful requests should be selected

The http client allows to maintain state by checking on the "Stateful requests" check-box. When this box is marked the client will maintain a session cookie and the server will be able to identify it as a single session.

Click Start Test.

 

6.

Observe the response time for each request in a new Graph window.

 

7.

After the progress indicator in the HTTP load tester window shows 100%, click Show Results Table.

 

8.

Observe the results in the Results window. At the end of the number of requests, the http client prints the http response received from the server. HTTP Reply Code shows 200, indicating that all the requests have succeeded with no error replies. Apart from seeing no errors in the "Results table" you should be able to verify that the state has been preserved by the number of rows that the client will print in the last HTTP response. Click Close.

 

 

Summary

In this lesson, you've learned how to:

 Use OC4J clusters
 Perform a stateful rolling upgrade

Back to Topic List

Related Information

Read about High Availability features on OTN

Oracle Application Server High Availability Guide

Back to Topic List

 Place the cursor over this icon to hide all screenshots.

 

 

 

Left Curve
Popular Downloads
Right Curve
Untitled Document