Starting servers using scripting

You can use scripting and the wsadmin tool to start servers.

Before you begin

Before starting this task, the wsadmin tool must be running. See the topic about starting the wsadmin scripting client for more information.

Procedure

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:
      Using Jacl:
      $AdminControl startServer serverName
      Using Jython:
      AdminControl.startServer('serverName')
    • The following example starts an application server with the node specified:
      • Using Jacl:
        $AdminControl startServer server1 mynode
      • Using 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:
      • Using Jacl:
        $AdminControl startServer serverName 10
        
      • Using 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 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 startServer serverName nodeName
      • Using Jython:
        AdminControl.startServer('serverName', 'nodeName')
    • The following example specifies the server name, the node name, and the wait time:
      • Using Jacl:
        $AdminControl startServer serverName nodeName 10
      • Using Jython:
        AdminControl.startServer('serverName', 'nodeName', 10)
      where 10 is the number of seconds that the process should wait before starting the server.