WAS v8.5 > Script the application serving environment (wsadmin) > Manage servers and nodes with scriptingStart servers using scripting
We can use scripting and wsadmin to start servers.
Before beginning
Before starting this task, wsadmin must be running. See the topic about starting the wsadmin scripting client using wsadmin.sh Start the wsadmin scripting client using wsadmin.sh article for more information.
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:
Jacl:
$AdminControl startServer serverName
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 the process should wait before starting the server.
Related
Use the wsadmin scripting AdminControl object for scripted administration
Start the wsadmin scripting client using wsadmin.sh
Reference
Commands for the AdminControl object using wsadmin.sh
startServer command