Starting servers using scripting
We can use scripting and the wsadmin tool to start servers.
See the topic about starting the wsadmin scripting client using wsadmin.sh Start the wsadmin scripting client article for more information.
Tasks
Use the startServer command to start the server. This command has several syntax options. For example:
- To start a server on a WebSphere Application Server single server edition, choose one of the following options:
- The following examples specify the server name only:
Use Jacl:
$AdminControl startServer serverNameUse Jython:
AdminControl.startServer('serverName')- The following example starts an application server with the node specified:
- Jacl:
$AdminControl startServer server1 mynode- Jython:
print AdminControl.startServer('server1', 'mynode')
Example output:
WASX7319I: The serverStartupSyncEnabled attribute is set to false. A start will be attempted for server "server1" but the configuration information for node "mynode" may not be current. WASX7262I: Start completed for server "server1" on node "mynode"- The following example specify the server name and wait time:
- Jacl:
$AdminControl startServer serverName 10- Jython:
AdminControl.startServer('serverName', 10)where 10 is the maximum number of seconds waiting for the server to start.
- To start a server on a WAS network deployment edition, choose one of the following options:
- The following example specifies the server name and the node name:
- Jacl:
$AdminControl startServer serverName nodeName- Jython:
AdminControl.startServer('serverName', 'nodeName')
- The following example specifies the server name, the node name, and the wait time:
- Jacl:
$AdminControl startServer serverName nodeName 10- Jython:
AdminControl.startServer('serverName', 'nodeName', 10)where 10 is the number of seconds that the process should wait before starting the server.
wsadmin AdminControl Start the wsadmin scripting client Commands for the AdminControl object startServer command