Example: Stopping a server using wsadmin
The following example stops an appserver with the node specified.
- The following command stops server1 in node mynode.
Using Jacl:
$AdminControl stopServer server1 mynode
Example output:
WASX7337I: Invoked stop for server "server1" Waiting for stop completion. WASX7264I: Stop completed for server "server1" on node "mynode"
Using Jython:
print AdminControl.stopServer('server1', 'mynode')
- The stop command has several command syntaxes.
If you have Network Deployment installation, use the one of following command syntax:
Using Jacl:
$AdminControl stopServer serverName nodeName $AdminControl stopServer serverName nodeName immediate
Using Jython:
AdminControl.stopServer('serverName', 'nodeName') AdminControl.stopServer('serverName', 'nodeName', 'immediate')
If you have appserver base installation, you can use the following syntax, in addition to the previous syntax:
Using Jacl:
$AdminControl stopServer serverName $AdminControl stopServer serverName immediate
Using Jython:
AdminControl.stopServer('serverName') AdminControl.stopServer('serverName', 'immediate')
The following lists the exit codes to use for starting or stopping a server:
Server state Return code Server initialization failed -1 Server initialization timed out -2 Server start in progress 1 Server is initializing the applications that are present 2 Server initialization is complete (successful) 0 Server stop failed -10 Server stop timed out -11 Server stop operation started 1000 Server successfully stopped 0