Skip to content

Commit b0bea1c

Browse files
authored
OWLS-93551: Changes to expose the server startup properties and add -XX:+CrashOnOutOfMemoryError to JAVA_OPTIONS. (#3706)
* Changes to expose the RestartMax and RestartInterval server startup properties and add `-XX:+CrashOnOutOfMemoryError` to JAVA_OPTIONS.
1 parent fc5e23e commit b0bea1c

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

documentation/4.0/content/managing-domains/domain-lifecycle/liveness-readiness-probe-customization.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,26 @@ The following operator-populated environment variables are available for use in
7878

7979
* A custom liveness probe must not fail (exit non-zero) when the WebLogic Server instance itself is unavailable. This could be the case when the WebLogic Server instance is booting or about to boot.
8080

81+
### Automatic restart of failed server instances by Node Manager
82+
83+
WebLogic Server provides a self-health monitoring feature to improve the reliability and availability of server instances in a domain. If an individual subsystem determines that it can no longer operate consistently and reliably, it registers its health state as `FAILED` with the host server. Each WebLogic Server instance, in turn, checks the health state of its registered subsystems to determine its overall viability. If one or more of its critical subsystems have reached the `FAILED` state, the server instance marks its health state as `FAILED` to indicate that it cannot reliably host an application.
84+
85+
Using Node Manager, server self-health monitoring enables the automatic restart of the failed server instances. The operator configures the Node Manager to restart the failed server a maximum of two times within a one-hour interval. It does this by setting the value of the `RestartMax` property (in the [server startup properties](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/nodem/java_nodemgr.html#GUID-26475256-2830-434B-B31F-A2D06F48B244) file) to `2` and the value of the `RestartInterval` property to `3600`. You can change the number of times the Node Manager will attempt to restart the server in a given interval by setting the `RESTART_MAX` and `RESTART_INTERVAL` environment variables in the domain resource using the `env` attribute under the `serverPod` element.
86+
87+
Use the following configuration to specify the number of times the Node Manager can attempt to restart the server within a given interval using the `RESTART_MAX` and `RESTART_INTERVAL` environment variables.
88+
```yaml
89+
serverPod:
90+
env:
91+
- name: RESTART_MAX
92+
value: "4"
93+
- name: RESTART_INTERVAL
94+
value: "3600"
95+
```
96+
97+
If the Node Manager can't restart the failed server and marks the server state as `FAILED_NOT_RESTARTABLE`, then the liveness probe will fail and the WebLogic Server container will be restarted. You can set the `RESTART_MAX` environment variable value to `0` to prevent the Node Manager from restarting the failed server and allow the liveness probe to fail immediately.
98+
99+
See [Server Startup Properties](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/nodem/java_nodemgr.html#GUID-26475256-2830-434B-B31F-A2D06F48B244) for more details.
100+
81101
### Readiness probe customization
82102

83103
Here are the options for customizing the readiness probe and its tuning:

documentation/4.0/content/samples/database/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ spec:
145145
- image: mysql:5.6
146146
name: mysql
147147
env:
148+
- name: MYSQL_ROOT_USER
149+
valueFrom:
150+
secretKeyRef:
151+
name: mysql-secret
152+
key: root-user
148153
- name: MYSQL_ROOT_PASSWORD
149154
valueFrom:
150155
secretKeyRef:

operator/src/main/resources/scripts/startNodeManager.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ if [ ! "${SERVER_NAME}" = "introspector" ]; then
248248
cat <<EOF > ${wl_props_file}
249249
# Server startup properties
250250
AutoRestart=true
251-
RestartMax=2
252-
RestartInterval=3600
251+
RestartMax=${RESTART_MAX:-2}
252+
RestartInterval=${RESTART_INTERVAL:-3600}
253253
NMHostName=${SERVICE_NAME}
254254
Arguments=${USER_MEM_ARGS} ${failBootOnErrorOption} ${serverOutOption} ${JAVA_OPTIONS}
255255

operator/src/main/resources/scripts/startServer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ if [[ "${KUBERNETES_PLATFORM^^}" == "OPENSHIFT" ]]; then
286286
fi
287287

288288
fi
289+
export JAVA_OPTIONS="${JAVA_XX_OPTIONS:--XX:+CrashOnOutOfMemoryError} $JAVA_OPTIONS"
289290

290291
#
291292
# Start WLS

0 commit comments

Comments
 (0)