Oracle9iAS Web Cache Sample - Personalized Portal Clustering

This document is organized into following sub-sections : Install instructions are documented here in this document as well as in the Viewlets, so that the users can follow either of them to install this sample.

Required Software

The software required for running the sample are :
  • Oracle9iAS J2EE and Web Cache Release 9.0.3 or higher - Production downloadable from here

  • Oracle9i Database Release 9.0.2 or higher - Production downloadable from here
  • Oracle Chart Builder downloadable from here
  • Oracle9i JDeveloper 9.0.3 downloadable from here (optional not required, if application is deployed using Oracle9iAS Enterprise Manager)
  • Ant (Version 1.5) downloadable from here (optional not required, if applicaiton is deployed using Oracle9i JDeveloper)
Please install the above software before proceeding further. For more information on installation of the above software, please follow the accompanied documentation with them.

This sample has been tested against the above mentioned software versions.
 

Notations Used

Notation 
Description
<OC4J_HOME> Folder where OC4J is installed. For example, D:\oc4j
<IAS_HOME> Folder where Oracle9iAS is installed. For example, D:\ora9ias
<SAMPLE_HOME> Folder where the MyPortalCluster sample was extracted. For example, C:\MyPortalCluster
<JAVA_HOME> Folder where JDK is installed. For example, D:\jdk1.3
<CHARTS_HOME> Folder where Oracle Chart Builder has been installed. For example, D:\ChartBuilder 

 

Extracting the sample

The sample is provided as a .jar file. Download and extract the MyPortalCluster.jar file.

jar -xvf MyPortalCluster.jar

Extraction of the jar file results in the creation of 'MyPortalCluster' directory and 4 sub directories within it.
 
 
doc This folder contains all the documentation related to know and run this application
src This folder contains the java beans used by the JSPs in this application
public_html This folder contains the JavaSever Pages files and other html files used by this application
sql This folder contains the sql file needed for running this application

Installation Steps

Database Setup

Viewlet for Database Setup

Follow the steps given below to setup the database.

Step 1:. Connect to the database that you would be using. For example, you can connect to scott/tiger or any other user. To create your own user, say 'portaldemo' user, follow the below mentioned steps :-


SQL> connect system/manager
SQL> Grant connect, resource to portaldemo identified by portaldemo;
SQL> connect portaldemo/portaldemo

Step 2:. Run tables.sql from <SAMPLE_HOME>\MyPortal\sql directory to create tables and data required by the system

SQL> @<SAMPLE_HOME>\MyPortalCluster\sql\tables.sql

Step 3:.Edit the file MyPortal.properties  in <base>\MyPortal\src\ directory . This java file contains database specific parameters, Oracle9iAS, Oracle9iAS Web Cache specific parameters and some application specific parameters. Change these values of the variables in this file, to reflect your environment.

Note : For DHCP users

    Those who have configured DHCP should ensure that they use the IP address allocated to their machine. This can be found by using the ipconfig command to determine the IP address.

The List of configurable parameters in the MyPortal.properties are :- (This property file should be changed accordingly to reflect user's environment).

Parameter Description
Database Specific Parameters
Database.hostName Machine name on which the Oracle9i database is installed
Database.portNumber Port number on which the database listens.
Database.sid SID of the database.
Database.userName User name on which the tables have been created.
Database.password Password for the user.
Oracle9iAS Web Cache Cluster Specific Parameters
Webcache.TotalInstances  Total number of cluster members configured with the cache cluster.
In the following, <n> is the web cache instance number participating in the cluster. 
for example, 
Webcache1.hostname = somehost1.com and
webcache2.hostname = somehost2.com
Webcache<n>.hostName Machine name/IPAddress on which Oracle9iAS Web Cache instance is installed. expects http:// to be prefixed to the machine name.
Webcache<n>.listenPort  Port on which Oracle9iAS Web Cache instance is made to listen to Oracle9iAS.
Webcache<n>.invalidationPort  Port on which Oracle9iAS Web Cache instance listens for invalidation messages.
Webcache<n>.administrationPort Port on which Oracle9iAS Web Cache instance Admin tool is running.
Webcache<n>.invalidationPassword Oracle9iAS Web Cache instance's invalidation password.
Webcache<n>.color HTML Color value to indicate the content from this cache.
Load Balancer
LoadBalancer.hostName Machine name/IPAddress on which Oracle9iAS Web Cache is configured as load balancer. To make Oracle9iAS Web Cache as load balancer, include this Web Cache Server in the Cluster and make the relative capacity of this Cache Server to 0. In practical scenario, this can be replaced with a network device to balance the load. 
LoadBalancer.listenPort  Port on which this instance of Web Cache is made to listen
LoadBalancer.invalidationPort  Port on which this instance of Web Cache listens for invalidation messages.
LoadBalancer.administrationPort Port on which this instance of Web Cache Admin tool is running.
LoadBalancer.invalidationPassword This Web Cache instance's invalidation password.
Oracle9iAS Specific Parameters
ApplicationServer.hostName  Machine name/IP Address on which OC4J is running. Please prefix "http://" to the machine name
ApplicaitonServer.listenPort Port on which OC4J listens to web requests
Proxy Server Details 
ProxyServer.hostName Machine name/IP Address of the proxy server, if any. If proxy server is not used, provide a blank value like ""
ProxyServer.portNumber  Port number of the proxy server, if any. If proxy server is not used, provide a blank value like "".

Setting DISPLAY for UNIX Terminals

This section contains instruction to set up the DISPLAY Environment on UNIX Server. Follow these steps, only if the Oracle9i Application Server runs on UNIX based servers.

Step 1:.Start XServer or VNC Server on the workstation

Step 2:.Edit <IAS_HOME>\opmn\conf\opmn.xml file

Add the following <prop..> element tag

<environment>
   .....

   <prop name="DISPLAY" value="usunnbe13.us.oracle.com:1"/>
</environment>

the value of this element is the display name for the vnc server.

Deploying the application to Oracle9iAS using Oracle9iAS Enterprise Manager


Viewlet for Oracle9iAS Enterprise Manager Deployment

This section describes the steps required in deploying this application to the Oracle9iAS using Oracle9iAS Enterprise Manager.

Step 1:  SET Environment Variables

  1. Open the Command Prompt and Go to the <SAMPLE_HOME> directory
  2. Ensure that <JAVA_HOME>\bin is in the PATH
  3. Ensure that <ANT_HOME>\bin is in the PATH
  4. Set IAS_HOME

  5. for example, set IAS_HOME = D:\ora9ias
  6. Set CHARTS_HOME

  7. for example, set CHARTS_HOME = D:\CHARTBUILDER
Step 2:  Build the EAR file
 
 

From <SAMPLE_HOME>\MyPortalCluster, execute ant

<SAMPLE_HOME>\MyPortalCluster> ant
 
 

  This will create the MyPortalCluster.ear file.

Step 3: Having created a MyPortalCluster.ear file, to deploy this application through Enterprise Manager (EM). Log into EM. The default admin user name is ias_admin . Once you get into EM, click on OC4J_home link under the System Components section.

Step 4:  From the Applications section, Click on "Deploy EAR File".  This takes you to the screen where you can choose to upload the EAR file you created.

Step 5: In the Step 2 of the Wizard, Choose the <SAMPLE_HOME>\MyPortalCluster\MyPortalCluster.ear that you created, by clicking the "Browse" button. In the Application Name text field, specify MyPortalCluster as the name. Click Next.

Step 6: In the Step 3 of the Wizard, Specify the "URLBinding" value as /MyPortalCluster and Click Finish. On successful deployment, EM displays a success message. Click OK to return to the main screen

Step 7: In the Step 8 of the Wizard, Click Deploy.

This will deploy the sample application to the Oracle9iAS.

Deploying the application to Oracle9iAS using Oracle9i JDeveloper

This section describes the steps required in deploying this application to the Oracle9iAS using Oracle9i JDeveloper

Step 1:. Open the <SAMPLE_HOME>\MyPortalCluster\MyPortalCluster.jws in Oracle9i JDeveloper. The workspace will contain MyPortalCluster.jpr (project file), JSP files and other files.

Step 2: Add ChartBuilder Library to the project

  1. Click the 'Project Settings...' from the 'Project' menu.
  2. Double Click the 'Libraries' in the list box.
  3. Select the 'ChartBuilder' from the Selected Libraries and Click the 'Edit' Button
  4. Select the 'Edit..' button from the Class Path Section
  5. Select the 'Add Entry' button and select the chartbuilder.jar. chartbuilder.jar will be found in <CHARTS_HOME>/lib directory
  6. Select 'Ok.' button in the Edit Classpath window
  7. Select 'Ok.' button in the Edit Library Window
  8. Select 'Ok.' button in the Project Settings Window

Step 3: Include Chartbuilder library in the deployment archive.

  1. Select Deployment-> MyPortalCluster.deploy under the MyPortalCluster.jpr
  2. Right Click and select the 'Settings...'
  3. Select WEB-INF\lib
  4. Select the 'chartbuilder.jar' under ChartBuilder
  5. Select 'Ok.' button

Step 4: Create an Application Server Connection

  1. Select Application Server unders the Connections Node.
  2. Right click on Application Servers and select "New Connection".
  3. Select 'Oracle 9i Application Server - Remote DCM' or Oracle 9i Application Server - Local DCM'
  4. Provide the appropriate connection information of the Application Server to which the sample is to be deployed.

Step 5: Right Click MyPortalCluster.deploy node and select "Deploy to <connection name>",  where the connection name is the name of the connection created in the previous step. This results in creation of war & ear files, followed by the deployment of this application to Oracle9iAS.

Configuring Oracle9iAS Web Cache Cluster


Viewlet for Configuring Oracle9iAS Web Cache Cluster

This section describes the steps to configure Oracle9iAS Web Cache Cluster.

Step 1 : Edit the internal.xml found in <IAS_HOME>\webcache. Ensure that the this ENABLEOUTBOUNDICC attribute is set to "YES". like

<INVALIDATION ENABLEOUTBOUNDICC="YES" />

Check this xml tag in all the web cache instances to be configured.

Step 2 : Start the Oracle9iAS Web Cache Admin Tool using the browser. By default the administration port is 4000. Access the Admin tool on the browser using the url

http://<hostname>:4000/webcacheadmin/
where <hostname> is the machine on which Oracle9iAS is installed.
For example, http://incq210a.idc.oracle.com:4000/webcacheadmin
Login as "administrator". The default password is 'administrator'.
Step 3 : Add Cluster members to form the Cluster
  1. Click the 'Cluster Configuration' link
  2. In the Cluster Member section, Click the 'Add..' Button
  3. Enter the Cluster Member host name, administration port and relative capacity of this Cluster
  4. Select the 'Submit' Button
  5. Repeat this Step to add all the cluster members
Step 4 : To Add Web Cache instance as the Load Balancer

Load Balancer is Cache instance in the cluster with relative capacity set as '0'. In typical scenario, this can be a network device.

  1. Click the 'Cluster Configuration' link on the left side of the admin page
  2. In the Cluster Member section, Click the 'Add..' Button
  3. Enter the Cluster Member host name, administration port
  4. Enter the relative capacity of this Cluster as '0'
  5. Select the 'Submit' Button
Step 5: Add Listening Ports for each Cluster Member
  1. Click the 'Listening Ports' Link on the left side of the admin page
  2. Choose each of the Cluster Instance
  3. Enter IP Address as 'ANY' and arbitrary Port number which is not used in that machine
  4. Select 'Submit' Button
  5. Repeat this Step to add a listening port to all cluster member including load balancer.
Step 6: Add Site Definition for each Cluster Member
  1. Click the 'Site Definitions' Link on the left side of the admin page
  2. Click the 'Add site' Button
  3. Enter the host name of the cluster member and the listening port created for this cluster instance in the last step
  4. Select 'Submit' Button
  5. Repeat this Step to add a 'Site Definition' to all cluster member including load balancer.
Step 7: Add Application Web Server
  1. Click the 'Application Web Server' Link on the left side of the admin page
  2. Click the 'Add..' Button
  3. Enter the host name , http listening port of the application server and other details of the Application Server
    for example,


    Hostname: incq234a.idc.oracle.com
    Port: 7777
    Capacity 100
    Failover Threshold: 5
    Ping URL: /
    Ping Interval (seconds): 10

  4. Select 'Submit' Button
Step 8 : Add Site to Server Mapping for each Cluster Member
  1. Click the 'Site to Server Mapping' Link on the left side of the admin page
  2. Click the last site from the list of defined sites and Click 'Insert Above' Button
  3. Select the 'Select from Site Definitions' radio button
  4. Select the Site defined for each of the cluster member in step 6, from the list box
  5. Select the Application Web Server added in step 7
  6. Select 'Submit' Button
  7. Repeat this Step to add a 'Site to Server Mapping' to all cluster member including load balancer.
Step 9 : Apply the Changes

Click the 'Apply Changes' Button on located on top of the admin page

Step 10 : Propagate Changes

Click the 'Propagate' Button to propagate the changes made to other cluster

Step 11 : Restart All

Click the 'Restart' Button to restart all the cache instances.

Now the Web cache Cluster in configured and each of the cluster member is mapped to the application server. Any request, directed to the web cache instance acting as the load balancer, would be routed to the cluster members.

For more information, refer Oracle9iAS Web Cache Administration and Deployment Guide.

Running the Sample Application


Viewlet for Running the Sample

Step 1: Ensure that both Oracle9iAS and Web Cache Cluster are running.

Step 2: Access the page on the browser, using the url

                  http://<host_name>:<port>/MyPortalCluster/Login.jsp
                  where, <host_name> is the machine on which Oracle9iAS Web Cache is configured as the load balancer and <port> is the port on which Web Cache listener is running.

                  For Example, http://incq234a.idc.oracle.com:8001/MyPortalCluster/Login.jsp

            New user's can sign up to the system and get a valid loginname.
 
 

Viewlets in the Sample.

  1. Database Setup (Viewlet, 0:51 mins)
  2. Oracle9iAS Enterprise Manager Deployment (Viewlet, 1:15 mins )
  3. Configure Oracle9iAS Web Cache Clustering (Viewlet, 3:50 mins)
  4. Running the Sample (Viewlet, 1:31 mins)


Please enter your comments about this sample in the OTN Sample code discussion forum.
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy