File tree Expand file tree Collapse file tree 5 files changed +23
-9
lines changed
operator/src/main/resources/scripts Expand file tree Collapse file tree 5 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 104
104
# setup ".out" location for a WL server
105
105
serverLogHome=" ${LOG_HOME:- ${DOMAIN_HOME} / servers/ ${SERVER_NAME} / logs} "
106
106
export SERVER_OUT_FILE=" ${serverLogHome} /${SERVER_NAME} .out"
107
+ export SERVER_PID_FILE=" ${serverLogHome} /${SERVER_NAME} .pid"
108
+ export SHUTDOWN_MARKER_FILE=" ${serverLogHome} /${SERVER_NAME} .shutdown"
107
109
serverOutOption=" -Dweblogic.Stdout=${SERVER_OUT_FILE} "
108
110
createFolder " ${serverLogHome} "
109
111
fi
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ function startWLS() {
72
72
73
73
trace " Start node manager"
74
74
# call script to start node manager in same shell
75
- # $SERVER_OUT_FILE will be set in startNodeManager.sh
75
+ # $SERVER_OUT_FILE, SERVER_PID_FILE, and SHUTDOWN_MARKER_FILE will be set in startNodeManager.sh
76
76
. ${SCRIPTPATH} /startNodeManager.sh
77
77
[ $? -ne 0 ] && trace SEVERE " failed to start node manager" && exitOrLoop
78
78
@@ -103,7 +103,7 @@ function waitUntilShutdown() {
103
103
#
104
104
if [ " ${SERVER_OUT_IN_POD_LOG} " == ' true' ] ; then
105
105
trace " Showing the server out file from ${SERVER_OUT_FILE} "
106
- ${SCRIPTPATH} /tailLog.sh ${SERVER_OUT_FILE} &
106
+ ${SCRIPTPATH} /tailLog.sh ${SERVER_OUT_FILE} ${SERVER_PID_FILE} &
107
107
fi
108
108
FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR=${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR:- true}
109
109
SERVER_OUT_MONITOR_INTERVAL=${SERVER_OUT_MONITOR_INTERVAL:- 3}
@@ -119,7 +119,7 @@ function waitForShutdownMarker() {
119
119
#
120
120
trace " Wait indefinitely so that the Kubernetes pod does not exit and try to restart"
121
121
while true ; do
122
- if [ -e /tmp/doShutdown ] ; then
122
+ if [ -e ${SHUTDOWN_MARKER_FILE} ] ; then
123
123
exit 0
124
124
fi
125
125
sleep 3
Original file line number Diff line number Diff line change @@ -107,12 +107,20 @@ def waitUntilCoherenceSafe():
107
107
print ('Shutdown: getting all service Coherence MBeans' )
108
108
query = 'Coherence:type=PartitionAssignment,service=*,*'
109
109
110
+ # By default, Coherence will use a single Weblogic Runtime MBean server to managed
111
+ # its MBeans. That server will correspond to the current Coherence senior member,
112
+ # which means that the Coherence MBeans will migrate to the oldest cluster member
113
+ # during rolling restart. By using the DomainRuntime MBean server (in admin server)
114
+ # we can get access to the Coherence MBeans, regardless of the local Runtime MBean
115
+ # server being used, since the DomainRuntime server is federated and will call the
116
+ # individual MBean servers to get the MBeans througout the domain.
117
+ domainRuntime ()
118
+
110
119
# Wait forever until we get positive ack that it is ok to shutdown this server.
111
120
done = False
112
121
warnSleep = True
113
122
while (not done ):
114
123
try :
115
- domainRuntime ()
116
124
beans = list (mbs .queryMBeans (ObjectName (query ), None ))
117
125
if beans is None or len (beans ) == 0 :
118
126
# during rolling restart the beans might not be available right away
Original file line number Diff line number Diff line change @@ -16,13 +16,16 @@ source ${SCRIPTPATH}/utils.sh
16
16
# setup ".out" location for a WL server
17
17
serverLogHome=" ${LOG_HOME:- ${DOMAIN_HOME} / servers/ ${SERVER_NAME} / logs} "
18
18
STOP_OUT_FILE=" ${serverLogHome} /${SERVER_NAME} .stop.out"
19
+ SHUTDOWN_MARKER_FILE=" ${serverLogHome} /${SERVER_NAME} .shutdown"
20
+ SERVER_PID_FILE=" ${serverLogHome} /${SERVER_NAME} .pid"
21
+
19
22
20
23
trace " Stop server ${SERVER_NAME} " & >> ${STOP_OUT_FILE}
21
24
22
25
checkEnv SERVER_NAME || exit 1
23
26
24
27
if [ " ${MOCK_WLS} " == ' true' ]; then
25
- touch /weblogic-operator/doShutdown
28
+ touch ${SHUTDOWN_MARKER_FILE}
26
29
exit 0
27
30
fi
28
31
@@ -79,9 +82,10 @@ if [ ! -z $pid ]; then
79
82
kill -15 $pid
80
83
fi
81
84
82
- touch /tmp/doShutdown
83
- if [ -f /weblogic-operator/pid ]; then
84
- kill -2 $( < /weblogic-operator/pid)
85
+ touch ${SHUTDOWN_MARKER_FILE}
86
+
87
+ if [ -f ${SERVER_PID_FILE} ]; then
88
+ kill -2 $( < ${SERVER_PID_FILE} )
85
89
fi
86
90
87
91
trace " Exit script" & >> ${STOP_OUT_FILE}
Original file line number Diff line number Diff line change 10
10
# running this script.
11
11
#
12
12
13
- echo $$ > /tmp/tailLog-pid
13
+ echo $$ > $2
14
14
tail -F -n +0 $1
You can’t perform that action at this time.
0 commit comments