Stopping servers using scripting
You can stop servers using scripting and the wsadmin tool.
Before you begin
About this task
Procedure
- To stop a server on a WebSphere Application Server
single server edition, choose one of the following options:
- The following examples specify the server name only:Using Jacl:
$AdminControl stopServer serverNameUsing Jython:AdminControl.stopServer('serverName') - The following examples stop an application server with the node specified:
-
Using Jacl:
$AdminControl stopServer serverName mynode -
Using Jython:
print AdminControl.stopServer('serverName', 'mynode')
Example output:WASX7337I: Invoked stop for server "serverName" Waiting for stop completion. WASX7264I: Stop completed for server "serverName" on node "mynode"When you stop a server by using the
stopServercommand, the normal server quiesce process is governed by thecom.ibm.ejs.sm.server.quiesceTimeoutJava virtual machine (JVM) custom property, which defaults to 180 seconds. -
-
- The following examples specify the server name and the
immediateargument:-
Using Jacl:
$AdminControl stopServer serverName immediate -
Using Jython:
AdminControl.stopServer('serverName', immediate)
When you stop a server by using the
immediateargument, thecom.ibm.ejs.sm.server.quiesceTimeoutJVM custom property employs a value of 0 seconds. -
- The following examples specify the server name and the
terminateargument:-
Using Jacl:
$AdminControl stopServer serverName terminate -
Using Jython:
AdminControl.stopServer('serverName', terminate)
Because using the
terminateargument is analogous to an OS command-linekill -9 <pid>command, some application clients might receive exceptions. Therefore, always attempt to stop a server by using theimmediateargument before you use theterminateargument. -
- The following examples specify the server name and the
- The following examples specify the server name only:
- To stop a server on a WebSphere Application Server network deployment edition, choose one of
the following options:
- The following example specifies the server name and the node name:
-
Using Jacl:
$AdminControl stopServer serverName nodeName -
Using Jython:
AdminControl.stopServer('serverName', 'nodeName')
-
When you stop a server by using the
stopServercommand, the normal server quiesce process is governed by thecom.ibm.ejs.sm.server.quiesceTimeoutJava virtual machine (JVM) custom property, which defaults to 180 seconds. - The following example specifies the server name, the node name, and the
immediateargument:-
Using Jacl:
$AdminControl stopServer serverName nodeName immediate -
Using Jython:
AdminControl.stopServer('serverName', 'nodeName', immediate)
-
When you stop a server by using the
immediateargument, thecom.ibm.ejs.sm.server.quiesceTimeoutJVM custom property employs a value of 0 seconds. - The following examples specify the server name, the node name, and the
terminateargument:-
Using Jacl:
$AdminControl stopServer serverName nodeName terminate -
Using Jython:
AdminControl.stopServer('serverName', 'nodeName', terminate)
Because using the
terminateargument is analogous to an OS command-linekill -9 <pid>command, some application clients might receive exceptions. Therefore, always attempt to stop a server by using theimmediateargument before you use theterminateargument. -
-
-
- The following example specifies the server name and the node name: