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.
Shutting down the server CRMDemo_server1 with force=false while connected to AdminServer ...
To make it shutdown forcibly, you need to modify the following line in the stopWebLogic.sh from:
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
DOMAIN_NAME
/bin/
stopManagedWebLogic.shmanaged_server_name
admin_url
username
password
- ./stopManagedWebLogic.sh CRMDemo_server1 t3://<machine_name>:7001 weblogic weblogic1
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"
- echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true', force='true')" >>"shutdown.py"
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
- Oracle® Fusion Middleware Managing Server Startup and Shutdown for Oracle WebLogic Server 11g Release 1 (10.3.4)
- WLST Command and Variable Reference
- Starting and Stopping Fusion Applications the Right Way (Oracle A-Team)
- Oracle WebLogic Server on Docker Containers (white paper)
- WebLogic on Docker (GitHub)
- Sample Docker configurations to facilitate installation, configuration, and environment setup for DevOps users. This project includes quick start dockerfiles and samples for both WebLogic 12.1.3 and 12.2.1 based on Oracle Linux and Oracle JDK 8 (Server).
4 comments:
Thanks, very much.
It's really help me.
Thanks, very helpful and direct.
-David M
Thanks so much.
Post a Comment