How to Force Shutdown WebLogic Managed Server

WebLogic Server (WLS) provides several ways to start and stop server instances[1]. The method that you choose depends on whether you prefer using the Administration Console or a command-line interface, and on whether you are using Node Manager to manage the server's life cycle.
 
In this article, we will show you how to force shutdown WLS Managed Server from the command-line. This may come in handy when your WLS Managed Servers have stuck threads and will take you minutes to connect to it using the Console. Also, you don't care about dropping any user sessions. For example, in our case, we are just running some performance benchmarks.
 
stopManagedWebLogic.sh
 You can stop WLS Managed Server using stopManagedWebLogic.sh script provided in your domain:
 •<domain_path>/bin
 Note that the environment we demonstrate here is in Linux.  The syntax of the command is:
 •DOMAIN_NAME/bin/stopManagedWebLogic.sh managed_server_name admin_url username password
 For example, we use:
 •./stopManagedWebLogic.sh CRMDemo_server1 t3://<machine_name>:7001 weblogic weblogic1
 However, the default setting is not FORCE SHUTDOWN as shown in the following output line:
 
Shutting down the server CRMDemo_server1 with force=false while connected to AdminServer ...
 
stopWebLogic.sh
 stopManagedWebLogic.sh actually invokes stopWebLogic.sh indirectly as shown here:
 

 ${DOMAIN_HOME}/bin/stopWebLogic.sh $1 $2
 
To make it shutdown forcibly, you need to modify the following line in the stopWebLogic.sh from:
 •echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true')" >>"shutdown.py"
 to
 •echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true', force='true')" >>"shutdown.py"
 Note that WLST shutdown command[2] is used to do the work in the script.
 
Sample Output
 After changing the script file, we re-execute the command and here is the sample output:
 
Stopping Weblogic Server...
 

Initializing WebLogic Scripting Tool (WLST) ...
 

 

Welcome to WebLogic Server Administration Scripting Shell
 

 

Type help() for help on available commands
 

 

Connecting to t3://<machine_name>:7001 with userid weblogic ...
 
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'xxxx'.
 

 

Warning: An insecure protocol was used to connect to the
 
server. To ensure on-the-wire security, the SSL port or
 
Admin port should be used instead.
 

 

Shutting down the server CRMDemo_server1 with force=true while connected to AdminServer ...
 
......................................................
 
Exiting WebLogic Scripting Tool.
 

 

Done
 
Stopping Derby Server...
 

Stopping Admin Server
 Because our change was done in stopWebLogic.sh, if you want to shutdown Admin Server, it also becomes FORCE SHUTDOWN as shown below:
 

$ ./stopWebLogic.sh
 
Stopping Weblogic Server...
 Initializing WebLogic Scripting Tool (WLST) ...
 

 

Welcome to WebLogic Server Administration Scripting Shell
 

 

Type help() for help on available commands
 

 

Please enter your username :weblogic
 
Please enter your password :
 
Connecting to t3://<server_name>:7001 with userid weblogic ...
 
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'atgdomain'.
 

 

Warning: An insecure protocol was used to connect to the
 
server. To ensure on-the-wire security, the SSL port or
 
Admin port should be used instead.
 

 

Shutting down the server AdminServer with force=true while connected to AdminServer ...
 
WLST lost connection to the WebLogic Server that you were
 
connected to, this may happen if the server was shutdown or
 
partitioned. You will have to re-connect to the server once the
 
server is available.
 
Disconnected from weblogic server: AdminServer
 
Disconnected from weblogic server:
 

 

 


Exiting WebLogic Scripting Tool.
 

 

Done
 
Stopping Derby Server...
 
Conclusion
 
Be warned that:
 •If you force shutdown server instances, the server immediately stops all processing. Therefore, any pending session data may be lost.
 •
 Each WebLogic Server instance runs in its own JVM. If you are unable to shut down a server instance using the methods described, you can use an operating system command to kill the JVM.  However, if you kill the JVM for an Administration Server while the server is writing to the config.xml file, you can corrupt the config.xml file.
 

References
 1.Oracle® Fusion Middleware Managing Server Startup and Shutdown for Oracle WebLogic Server 11g Release 1 (10.3.4)
 2.WLST Command and Variable Reference
 3.Starting and Stopping Fusion Applications the Right Way (Oracle A-Team)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值