- Oracle WebLogic Server 12c Advanced Administration Cookbook
- Dalton Iwazaki
- 624字
- 2025-04-04 22:44:31
Configuring HA WebLogic cluster parameters
This recipe will cover other WebLogic cluster adjustments needed for high availability in production. The parameters are Failure Action, Panic Action, Cluster Address, and Number of Servers in Cluster Address for the cluster, and CrashRecoveryEnabled for Node Manager.
Getting ready
To change the Node Manager CrashRecoveryEnabled parameter, edit the configuration $WL_HOME/common/nodemanager/nodemanager.properties
file in all machines.
The cluster parameters are changed using the Administration Console or WLST.
How to do it...
To change the Node Manager's parameter:
- Log in as a
wls
user to shell and shutdown Node Manager:[wls@prod01]$ ps aux | grep weblogic.NodeManager | grep -v grep | awk '{print $2}' <PID> [wls@prod01]$ kill -9 <PID>
- Edit
nodemanager.properties
:[wls@prod01]$ vi $WL_HOME/common/nodemanager/nodemanager.properties
- Locate the
CrashRecoveryEnabled
parameter and change the line:From:
CrashRecoveryEnabled=false
To:
CrashRecoveryEnabled=true
- Type
:wq!
to save the file and exit. - Start Node Manager:
[wls@prod01]$ cd $WL_HOME/server/bin [wls@prod01]$ nohup ./startNodeManager.sh &
- Repeat the steps on every machine in the domain.
To change the cluster parameters:
- Access the Administration Console with your web browser at
http://prod01.domain.local:7001/console
. - Click on the Lock & Edit button to start a new edit session.
- Expand the Environment tree on the left and click on Clusters.
- Click on the
PROD_Cluster
cluster to navigate to Configuration | General and type4
in the Number Of Servers In Cluster Address field. Leave the Cluster Address field empty and click on the Save button. - Click on the Advanced link to display extra options and then select the WebLogic Plug-in Enabled checkbox, as shown in the following screenshot:
- Click on the Save button.
- Click on the Overload tab to navigate to Configuration | Overload of
PROD_Cluster
. - Change the Failure Action drop-down menu to Force immediate shutdown of this cluster and the Panic Action field to Exit the cluster process (as shown in the following screenshot):
- Click on the Save button and then the Activate Changes button.
- Restart all Managed Servers of the
PROD_Cluster
cluster.
How it works...
Failure Action and Panic Action are the WebLogic overload settings that can shutdown a Managed Server when it reaches a FAIL
state or when it throws an Out of Memory (OOM) PANIC error. Both errors would leave the affected Managed Server in an inconsistent state and would probably hang or return application errors to client requests. The Node Manager monitors the Managed Servers and restarts the failed instance automatically. Unless there is an analysis of the root cause of these errors, it's recommended to enable both parameters.
CrashRecoveryEnabled is the Node Manager parameter that must be enabled so Node Manager can restart a crashed/failed WebLogic Managed Server instance automatically.
The Cluster Address, Number of Servers in Cluster Address, and WebLogic Plug-in Enabled are cluster configurations for the distribution of requests and load balancing.
Note
The Cluster Address configuration is used by the Enterprise JavaBeans (EJB) and RMI objects deployed in the cluster. Leave the Cluster Address configuration empty so the EJBs create the cluster address dynamically based on which network channel the request is received.
If the request is received on the default network channel, the cluster address is created using the default network channel listen address and listen port. If the request is received on a custom network channel, the cluster address is created using the custom network channel listen address and listen port.
There's more...
The cluster settings can also be modified through WLST.
Changing the cluster settings using WLST
- Log in as a
wls
user to shell and start WLST:[wls@prod01]$ $WL_HOME/common/bin/wlst.sh
- Connect to the Administration Server using
wlsadmin
as the user,<pwd>
as the password andt3://prod01.domain.local:7001
as the server URL:wls:/offline> connect("wlsadmin","<pwd>","t3://prod01.domain.local:7001")
- Run the following WLST commands to create the cluster and the server instances:
edit() startEdit() cd('/Clusters/PROD_Cluster') cmo.unSet('clusterAddress') cmo.setNumberOfServersInClusterAddress(4) cmo.setWeblogicPluginEnabled(true) cd('/Clusters/PROD_Cluster/OverloadProtection/PROD_Cluster') cmo.setPanicAction('system-exit') cmo.setFailureAction('force-shutdown') cmo.createServerFailureTrigger() cd('/Clusters/PROD_Cluster/OverloadProtection/PROD_Cluster/ServerFailureTrigger/PROD_Cluster') cmo.setMaxStuckThreadTime(600) cmo.setStuckThreadCount(0) activate() exit()