Oracle 8i | Oracle 9i | Oracle 10g | Oracle 11g | Oracle 12c | Miscellaneous | PL/SQL | SQL | Oracle RAC | Oracle Apps | Linux

WebLogic Server 12cR2 : Clustered Domains

This article describes how to create a two-node clustered domain using Oracle WebLogic 12cR2.

Related articles.

Install WebLogic 12cR2

Make sure both machines have WebLogic 12cR2 installed. An example of these installations can be found here:

The example here also includes the ADF Application Developer Runtime. If you plan on building a clustered domain for deployment of ADF applications, you will also need to configure the following before moving on.

Once the installation is complete on both machines, come back to this article to create the clustered domain.

Create the Clustered Domain

The details of the cluster being built in this article are as follows.

Machines        : wls12cr2-1.localdomain,
                  wls12cr2-2.localdomain

Domain Name     : clusterDomain


Managed Servers : AdminServer     - Running on wls12cr2-1.localdomain
                  clusterServer_1 - Running on wls12cr2-1.localdomain
                  clusterServer_2 - Running on wls12cr2-2.localdomain

Cluster         : cluster_1

Creation of a clustered domain can be done from the administration console, the command line or the configuration wizard. In my opinion, using the configuration wizard is the quickest way to get the job done. Start the configuration wizard.

$ $WLS_HOME/common/bin/config.sh

Accept the "Create a new WebLogic domain" option and enter the domain location, including the domain name at the end of the location. In this case I used "/u01/app/oracle/config/domains/clusterDomain". Click the the "Next" button.

Configuration Type

Select the product templates the domain requires and click the "Next" button. Depending on the options you pick, a number of additional steps may be included.

Templates

Enter the application location, including the domain name in the path, and click the "Next" button.

Application Location

Enter the administor account credentials and click the "Next" button.

Administrator Account

Enter the domain mode and JDK, then click the "Next" button.

Domain Mode and JDK

Select the "RCU Data" option and enter the database details. Click the "Get RCU Configuration" button.

Database Configuration Type

Once the details are retrieved, click the "Next" button.

Database Configuration Type

Accept the component datasources by clicking the "Next" button.

Component Datasources

Once the JDBC tests have completed successfully, click the "Next" button.

JDBC Test

Select the advanced configuraton options you require and click the "Next" button. For this example I checked the first three options. Depending on the options you pick, extra steps may be added.

Advanced Configuration

Enter the administration server details and click the "Next" button.

Administration Server

Select the type of node manager you require and enter the credentials. Click the "Next" button.

Node Manager

Add the managed servers for the domain, making sure the listen address is referring to the appropriate machine for each. When you are finished, click the "Next" button.

Managed Servers

Add a cluster entry, remember to add the appropriate cluster address. This can be a comma-separated list of "IP/DNS_Name:port" for the managed servers, a DNS name that maps to multiple IP addresses or the local machine if all servers run on one machine. Click the "Next" button.

Clusters

Associate the managed servers with the cluster and click the "Next" button.

Assign Servers to Clusters

Accept the Coherence Cluster setting by clicking the "Next" button.

Coherence Clusters

Click the "Unix Machine" tab and add the machines used by the cluster. I've used the fully qualified machine names in all cases. Click the "Next" button.

Machines

Assign the managed servers to the machines in the cluster and click the "Next" button.

Assign Servers to Machines

If you are happy with the summary information, click the "Create" button.

Summary

Once the configuration is complete click the "Next" button.

Configuration Progress

Make a note of the Admin Server URL and click the "Finish" button.

Configuration Success

Start Node Manager and Domain on First Machine

If the node manager is not already started on the first server, start it now.

$ export DOMAIN_HOME=$ORACLE_BASE/config/domains/clusterDomain
$ nohup $DOMAIN_HOME/bin/startNodeManager.sh &

Start the new domain on the first machine.

$ $DOMAIN_HOME/startWebLogic.sh

This second command will keep hold of the session. That is a good thing right now. Wait for the "RUNNING" state before proceeding.

Note. It may seem odd that you are starting the AdminServer in the new domain, then immediately stopping it in the next section (assuming you do not reset the node manager password), but some of the configuration is not written to the file system until the AdminServer is started for the first time, so don't skip this step.

Create a Boot Identity File

Create a boot identity file for the domain.

$ export DOMAIN_HOME=$ORACLE_BASE/config/domains/clusterDomain
$ mkdir -p $DOMAIN_HOME/servers/AdminServer/security
$ echo "username=weblogic" > $DOMAIN_HOME/servers/AdminServer/security/boot.properties
$ echo "password=Password1" >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties

Transfer Domain to Second Machine

On the first machine, stop the newly created domain. The easiest way to do this is to go into the session that is currently running it and issue "CTRL+C".

We will transfer the relevant configuration using the pack and unpack utilities.

On the first machine, pack the domain configuration using the following commands. Remember to amend the DOMAIN_HOME environment variable and the -template_name parameter to match your domain.

$ export DOMAIN_HOME=$ORACLE_BASE/config/domains/clusterDomain
$ cd $WL_HOME/common/bin 
$ ./pack.sh -managed=true -domain=$DOMAIN_HOME -template=${DOMAIN_HOME}-template.jar -template_name=clusterDomain

Copy the resulting jar file to the second machine.

$ scp ${DOMAIN_HOME}-template.jar oracle@wls12cr2-2.localdomain:/u01/app/oracle/config/domains

Unpack the configuration on the second machine. Remember to amend the DOMAIN_HOME environment variable to match your domain.

$ export DOMAIN_HOME=$ORACLE_BASE/config/domains/clusterDomain
$ cd $WL_HOME/common/bin
$ ./unpack.sh -domain=$DOMAIN_HOME -template=${DOMAIN_HOME}-template.jar

Restart the domain on the first machine. Wait until it is fully started before continuing.

$ $DOMAIN_HOME/startWebLogic.sh

Enroll Second Machine

On the second machine, start WLST.

$ $WLS_HOME/common/bin/wlst.sh

Connect to the administration server manager on the first machine, enroll the current machine, disconnect and exit WLST.

connect('weblogic', 'Password1', 't3://wls12cr2-1.localdomain:7001')

nmEnroll('/u01/app/oracle/config/domains/clusterDomain', '/u01/app/oracle/config/domains/clusterDomain/nodemanager')

disconnect()
exit()

Check the "$MW_HOME/domain-registry.xml" file contains an entry like the following. If it doesn't, add it manually.

<domain location="/u01/app/oracle/config/domains/clusterDomain"/>

Check the "$DOMAIN_HOME/nodemanager/nodemanager.domains" file contains an entry like the following. If it doesn't, add it manually.

clusterDomain=/u01/app/oracle/config/domains/clusterDomain

If the node manager is not already started on this server, start it now.

$ nohup $DOMAIN_HOME/bin/startNodeManager.sh &

Check Node Manager on Each Machine

Check the node manager is reachable on each machine.

Start Up

Provided the node manager is up on all servers, you can now start/stop the managed servers on both machines from the command line. The following example shows how you might do this.

$ # Start on each server.
$ nohup $WLS_HOME/server/bin/startNodeManager.sh > /dev/null 2>&1 &

$ # Start the managed servers from any server.
$ # Requires boot identity file for this to work as a background process.
$ nohup $DOMAIN_HOME/startWebLogic.sh > /dev/null 2>&1 &
$ nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh clusterServer_1 > /dev/null 2>&1 &
$ nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh clusterServer_2 > /dev/null 2>&1 &

Provided the administration server is available, you can manage the other managed servers from the console.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.