2.5 Setting Up a WebLogic Cluster
A WebLogic Server cluster consists of multiple WebLogic Server Managed server instances running simultaneously and working together to provide increased scalability and reliability. A cluster appears to clients to be a single WebLogic Server instance. The server instances that constitute a cluster can run on the same machine, or be located on different machines.
A cluster’s capacity can be increased by adding additional Managed server instances to the cluster on an existing machine, or by adding machines to the cluster to host the incremental Managed server instances. Each server instance in a cluster must run the same version of WebLogic Server.
Typically, the administration for the WebLogic Server instance is done through an Administration Server or Admin Server. The Managed Servers do not require the Administration Server to be up and running.
Prerequisites
Make sure that the following prerequisites are met before configuring a WebLogic cluster:
- Experience in setting up a WebLogic Server cluster is required!
- The WebLogic software needs to be installed on all the machines that will be part of the cluster (that will run WebLogic server instances). Make sure that the same version of the WebLogic software is installed on all nodes.
An OHI Components application release bundle contains scripts that may be used to automate the creation of a WebLogic Cluster.
Using these requires experience in setting up a WebLogic Server cluster. The scripts are located in <OHI_ROOT>/util/wlst. Note that the scripts are provided "as is".
Before using the scripts, stage these to the environment in which they will be applied and make sure that the scripts can be executed.
If the cluster setup is for a distributed environment, make sure to stage the files on a shared disk so that all machines can access these.
Before executing the steps to create a WebLogic Cluster, the following must be done in preparation:
- Change the setEnv.sh script to match the settings of the environment in which the scripts will be applied, e.g. set the correct Middleware Home (MW_HOME) and reference a Java Home.
- Populate the wlst\properties\createOHIDomain.properties file with the values for the desired setup.
The OHI Domain creation script supports the following Domain Topologies:
- Admin Server + single Managed Server (single host)
- Admin Server + single Managed Server (distributed)
- Admin Server + multiple Managed Servers (single host)
- Admin Server + multiple Managed Servers (distributed)
- Admin Server + multiple Clustered Managed Servers (single host)
- Admin Server + multiple Clustered Managed Servers (distributed)
- Admin Server + multiple Clusters (one for each OHI Component application) that consist of multiple Managed Servers each (single host)
Sample configuration files are provided in <OHI_ROOT>\util\wlst\properties\samples for all Domain Topologies mentioned.
Steps for setting up a WebLogic Cluster
Perform the following steps for setting up a WebLogic Cluster:
- Set up a Node Manager on all hosts in the cluster.
- Create a WebLogic domain.
- Generate node manager boot & startup properties.
- Register the Domain with the Node Manager.
- Optional: Create WebLogic Domain Template for secondary hosts.
- Set up a load balancer to distribute requests to different managed servers in the cluster.
Before putting the domain into production, make sure that the environment is secure. See the specific WebLogic documentation with respect to "Securing a Production Environment".
Starting and stopping WebLogic Server is covered in the Operations Guide.
Set up a Node Manager for all nodes in the cluster
This step must be performed on all hosts (primary and secondary) that will be part of the WebLogic Server domain.
Node Manager is a WebLogic Server utility that controls start, shut down, and restart of Administration Server and Managed Server instances from a remote location. A Node Manager process is not associated with a specific WebLogic domain but with a machine. The same Node Manager process can be used to control server instances in any WebLogic Server domain, as long as the server instances reside on the same machine as the Node Manager process. Node Manager must run on each computer that hosts WebLogic Server instances -whether Administration Server or Managed Server- that need to be controlled with Node Manager.
Before a domain is created set up a Node Manager. The Node Manager will run as "init.d" service. Use the <OHI_ROOT>\util\wlst\registerNodeManagerService.sh script (as root) to create the nodemgrservice file and to set the correct property values in the nodemanager.properties file:
- StopScriptEnabled=true
- CrashRecoveryEnabled=true
- StartScriptEnabled=true
All scripts are driven from properties for which the values are specified in the <OHI_ROOT>/util/wlst/properties/createOHIDomain.properties file.
Create a WebLogic domain for OHI Components in the cluster
This step must be performed on the primary host only.
Use the WebLogic Configuration Wizard to create a domain for OHI Components. Alternatively, use the <OHI_ROOT>/util/wlst/createOHIDomain.sh script (as oracle user). From one domain multiple OHI Components applications can be executed. Oracle recommends that each OHI Component application is executed in an application-specific cluster that consists of one or more application-specific managed servers.
Oracle suggested values for configuration of the WebLogic Cluster are listed in the following table:
Parameter |
Suggested Value |
---|---|
Domain Name |
ohi_domain |
Administration Server Name |
ohi_admin_server |
Managed Server Name(s) |
<OHI Components Application name>_nodeX (where X is an integer value that starts with 1). For example: claims_node1 |
Cluster Name |
<OHI Components Application name>_cluster. For example: claims_cluster |
Note that these values can be set in the <OHI_ROOT>\util\wlst\properties\createOHIDomain.properties file.
Required setting: make sure that the Server Start Mode for the domain is set to Production Mode.
Generate node manager boot & startup properties
Make sure that the server is up and running.
The easiest way to do is by using the <OHI_ROOT>/util/wlst/generateNMPropsOHIDomain.sh script (as oracle user). Make sure that the <OHI_ROOT>/util/wlst/properties/createOHIDomain.properties file has all required values.
The generateNMPropsOHIDomain.sh script needs to be executed from the root directory of the WebLogic domain that was created.
Verify that the boot.properties and startup.properties files were created correctly for all server instances and in the proper location ($DOMAIN_HOME/servers/[SERVER_NAME]/data/nodemanager.
Register the Domain with the Node Manager
Make sure that the server is up and running.
Enroll the domain (i.e. register the domain with the node manger service) by running <OHI_ROOT>/util/wlst/properties/enrollOHIDomain.sh (as oracle user). Verify that the enroll operation was successful, by checking the script output for "Successfully enrolled…".
The enrollOHIDomain.sh script needs to be executed from the root directory of the WebLogic domain that was created.
Set Environment Variables for OHI Components applications
The WLST script creates an OHI Components application specific shell script in <DOMAIN_DIR>/bin folder. Note that the shell script is populated with template values that require changes before an OHI Component application can be executed.
Optional: Create WebLogic Domain Template for secondary hosts
This step is only required if Managed Servers are defined that run on other hosts than the Admin Server.
Execute the "pack" command to create a WebLogic Domain Template for all
secondary host machines. Alternatively, use the
<OHI_ROOT>\util\wlst\packOHIDomain.sh
script to do that. The script requires the fully qualified root directory of the
WebLogic domain that was created as an input parameter.
Transfer the generated WebLogic Domain Template to all secondary host machines.
The template can now be removed from the primary host.
On any secondary host machine, use the "unpack" command to create the WLS Domain Directory. Alternatively, use the <OHI_ROOT>\util\wlst\unpackOHIDomain.sh script to do that. The script requires two arguments:
- a reference to the generated WebLogic Domain Template
- the fully qualified root directory of the WebLogic domain that was created as an input parameter
Set up a Load Balancer
A load balancer is needed to distribute incoming requests to the participating nodes in the cluster. Details about configuration of load balancers can be found in Oracle Fusion Middleware Using Clusters for Oracle WebLogic Server.
OHI Components requires that HTTP session "stick" to the same node; that needs to be supported by the load balancer. OHI Components applications maintain the session by sending a cookie to the client. The name of the cookie is OHISESSION.
OHI Components does not support HTTP Session state replication.
Final steps
The domain is almost ready to deploy the application. Perform these final steps before deployment:
- Configure the OHI Components application specific properties file, set up the logging configuration file logback.xml and put the ohi-security.config file in the proper place.
- Configure the Coherence cluster.
Before putting a domain into production, make sure that the environment is secure. See the specific WebLogic documentation with respect to "Securing a Production Environment".