Monday, April 05, 2004


OracleAS Clustering and JDeveloper

OracleAS File Based Clustering is one of those good ideas from the development folks we have up in Portland that I happened to configure once again while fixing up my machine.  Thinking I will be doing this again soon, I thought I would write up the steps.  While it is not perfect hopefully this tour of screenshots and basic steps will give a sense of the power of this feature - a few more GUI touches in Enterprise Manager and this one is baked, though pretty darn compelling as is.

This came about because  I once again have a Windows XP laptop which I was configuring up and installing a fresh machine is always a chance for trying some fun stuff.  I have been living with laptop problems for the last month working through a motherboard replacement, screen replacement and keyboard replacement.  I was originally trying to get my second hard drive operating with Windows so I could move my blog back (after living on  Linux for while on my other drive) when everything seemed to die all at once.  I am not sure why this replacement approach was cheaper than buying a new one ... I'll leave that story to the intricacies of corporate purchasing and warranties at a large company.

Simultaneous to me getting my laptop in good working order was the release of the Windows version of OracleAS.  After tracking it down, I promptly installed the "J2EE and WebCache option" twice in two separate Oracle homes <ORACLE_HOME1> (c:oracleproduct9.04home1) and <ORACLE_HOME2> (c:oracleproduct9.04home2), planning to set up a cluster.  As part of the install, I named the first instance "instance1" and the second instance "instance2".

The official doc on configuring the cluster from here on in is here:

http://download-west.oracle.com/docs/cd/B10464_02/core.904/b10495/midtiermanage.htm#i1026395 

so don't expect all the idiosyncracies to be noted here.  Sometimes, however, it is nice to see just the minimal steps rather than all the options you can choose from. Here are the steps I did:

1. Exited out to DOS and typed in the command:

<ORACLE_HOME1>\dcm\bin\dcmctl getRepositoryid

2. In my case the repository id was mlehmann-lap.us.oracle.com:7100.  To create a Farm, which is the logical unit in which clusters are contained, I typed in the following DCM command:

<ORACLE_HOME1>\dcm\bin\dcmctl joinFarm -r mlehmann-lap.us.oracle.com:7100

3. That added instance 1 to the cluster.  Next I needed to add instance 2 to the cluster.  It was the same as step 2 but executed the other home:

<ORACLE_HOME2>\dcm\bin\dcmctl joinFarm -r mlehmann-lap.us.oracle.com:7100

4.  Now I had to go to Application Server Control (http://mlehmann-lap:1810) to take a look. Below you can see that I had/have two instances in my farm but no cluster - just a farm.

5. By clicking on the "Create Cluster" button I then walked through a one step wizard where I logically named the cluster.  In my case I named it "cluster1". This could also have been done from the dcm command line but being lazy I went for the GUI.

6. Next I had to add the instances I had within my farm to the cluster.  I clicked on "Join Cluster" for each instance to do this (again available from the dcm command line too):

What this did is synchronize the configurations so they were identical across each instance.  So if I had, as I did, a particular OC4J instance configuration in <ORACLE_HOME1> installation, for example OC4J1, the management infrastructure ensures that in <ORACLE_HOME2> I get an identically configured OC4J1 in <ORACLE_HOME2>. Further any changes (security, new applications, startup parameters etc) I make in either instance is automatically propogated to the other instance. Cool.

8. My next step was to test this out so I decided to use JDeveloper to deploy a Web service to my OracleAS instance.  Since JDeveloper 9.0.3, there has been the ability to configure deployment through the DCM infrastructure of OracleAS (versus just the admin.jar utility for stand-alone OC4J).  So I wired up a JDeveloper connection to one of my instances of OracleAS.  See one screen shot my configuration below (this is from JDeveloper 10g - a slightly later build than the preview that is currently available):

9.  Then I deployed a Web service to that single instance as shown here by clicking on the deployment profile (which represents a configuration of an ear file) and chose deploy to OracleAS 904 - the connection I created above.

10. When I checked out the management console to see what happened (granted this was a couple minutes later ... my machine was tired running two OracleAS instances, one 10g DB, JDeveloper amongst other things), I found my Web service was distributed automagically to the entire cluster, from that single operation from JDeveloper.

In real life you would to a cluster deployment from the management console of Application Server Control or if in an automated environment using the DCM command line equivalents to the EM GUI, but there is some entertainment being able to do cluster deployments from JDev.

Overall, however, not bad for about 45 minutes of mucking around including installs (though I had the software right there - no downloads included!)



comment []
10:41:20 PM