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 104104 # setup ".out" location for a WL server
105105 serverLogHome=" ${LOG_HOME:- ${DOMAIN_HOME} / servers/ ${SERVER_NAME} / logs} "
106106 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"
107109 serverOutOption=" -Dweblogic.Stdout=${SERVER_OUT_FILE} "
108110 createFolder " ${serverLogHome} "
109111fi
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ function startWLS() {
7272
7373 trace " Start node manager"
7474 # 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
7676 . ${SCRIPTPATH} /startNodeManager.sh
7777 [ $? -ne 0 ] && trace SEVERE " failed to start node manager" && exitOrLoop
7878
@@ -103,7 +103,7 @@ function waitUntilShutdown() {
103103 #
104104 if [ " ${SERVER_OUT_IN_POD_LOG} " == ' true' ] ; then
105105 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} &
107107 fi
108108 FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR=${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR:- true}
109109 SERVER_OUT_MONITOR_INTERVAL=${SERVER_OUT_MONITOR_INTERVAL:- 3}
@@ -119,7 +119,7 @@ function waitForShutdownMarker() {
119119 #
120120 trace " Wait indefinitely so that the Kubernetes pod does not exit and try to restart"
121121 while true ; do
122- if [ -e /tmp/doShutdown ] ; then
122+ if [ -e ${SHUTDOWN_MARKER_FILE} ] ; then
123123 exit 0
124124 fi
125125 sleep 3
Original file line number Diff line number Diff line change @@ -107,12 +107,20 @@ def waitUntilCoherenceSafe():
107107 print ('Shutdown: getting all service Coherence MBeans' )
108108 query = 'Coherence:type=PartitionAssignment,service=*,*'
109109
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+
110119 # Wait forever until we get positive ack that it is ok to shutdown this server.
111120 done = False
112121 warnSleep = True
113122 while (not done ):
114123 try :
115- domainRuntime ()
116124 beans = list (mbs .queryMBeans (ObjectName (query ), None ))
117125 if beans is None or len (beans ) == 0 :
118126 # 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
1616# setup ".out" location for a WL server
1717serverLogHome=" ${LOG_HOME:- ${DOMAIN_HOME} / servers/ ${SERVER_NAME} / logs} "
1818STOP_OUT_FILE=" ${serverLogHome} /${SERVER_NAME} .stop.out"
19+ SHUTDOWN_MARKER_FILE=" ${serverLogHome} /${SERVER_NAME} .shutdown"
20+ SERVER_PID_FILE=" ${serverLogHome} /${SERVER_NAME} .pid"
21+
1922
2023trace " Stop server ${SERVER_NAME} " & >> ${STOP_OUT_FILE}
2124
2225checkEnv SERVER_NAME || exit 1
2326
2427if [ " ${MOCK_WLS} " == ' true' ]; then
25- touch /weblogic-operator/doShutdown
28+ touch ${SHUTDOWN_MARKER_FILE}
2629 exit 0
2730fi
2831
@@ -79,9 +82,10 @@ if [ ! -z $pid ]; then
7982 kill -15 $pid
8083fi
8184
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} )
8589fi
8690
8791trace " Exit script" & >> ${STOP_OUT_FILE}
Original file line number Diff line number Diff line change 1010# running this script.
1111#
1212
13- echo $$ > /tmp/tailLog-pid
13+ echo $$ > $2
1414tail -F -n +0 $1
You can’t perform that action at this time.
0 commit comments