Creating a server using scripting

Use the commands in the ServerManagement command group for the AdminTask object or the AdminServerManagement script library to create a new application server, Web server, proxy server, or generic server.

Before you begin

There are three ways to complete this task. This topic uses the AdminConfig object and the commands for the AdminTask object to create a new server configuration. Alternatively, you can use the scripts in the AdminServerManagement script library to create an application server, Web server, proxy server, or generic server.

Procedure

  1. Start the wsadmin scripting tool.
  2. Obtain the configuration ID of the node object.

    [oct2010] The following examples obtain the configuration ID of the node object and assigns it to the node variable. In these examples, myNode is the name of the node to which you are adding the new server, myserv is the name of the server you are creating, and node is a node object. The AdminTask.createApplicationServer() command requires you to specify a node name and the node name needs to be enclosed with quotes. The AdminConfig.create() command requires you to specify a node object, which you issue the AdminConfig.getid('/Node:mynode/') command to obtain. [oct2010]

    oct2010

    • Using Jacl:
      set node [$AdminConfig getid /Node:mynode/]
    • Using Jython:
      node = AdminConfig.getid('/Node:mynode/')
  3. Determine whether to use the AdminConfig or AdminTask object to create the server.
  4. Create the server.
    • The following example uses the commands for the AdminTask object to create a server:
      Using the AdminTask object:
      • Using Jacl:

        $AdminTask createApplicationServer mynode 
        {-name test1 –templateName default}
      • Using Jython:

        [oct2010]
        AdminTask.createApplicationServer('mynode', 
        ['-name', 'test1', '-templateName', 'default'])
        [oct2010]
        oct2010
    • The following example uses the AdminConfig object to create a server:
      Using the AdminConfig object:
      • Using Jacl:

        [oct2010]
        $AdminConfig create Server $node {name myserv}
        [oct2010]
        oct2010
      • Using Jython:

        [oct2010]
        AdminConfig.create('Server', node, ['name', 'myserv']
        [oct2010]
        oct2010
  5. Save the configuration changes.
    Use the following command example to save your configuration changes:
    AdminConfig.save()



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 3:36:59 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-express-iseries&topic=txml_createserver
File name: txml_createserver.html