Creating an application server involves a configuration command. Perform the following steps to create a server:
Procedure
- Obtain the configuration ID of the object and assign it to the mynode variable, for example:
Using Jacl:
set node [$AdminConfig getid /Node:mynode/]
Using Jython:
node = AdminConfig.getid('/Node:mynode/')
- There are two ways to create the server using the node that you specified in the first step. Perform one of the following:
- Using the AdminTask object:
Using Jacl:
$AdminTask createApplicationServer mynode
{-name test1 –templateName default}
Using Jython:
AdminTask.createApplicationServer(mynode,
['-name', 'test1', '-templateName', 'default'])
- Using the AdminConfig object:
Using Jacl:
$AdminConfig create Server $node {{name myserv}
{outputStreamRedirect {{fileName myfile.out}}}}
Using Jython:
AdminConfig.create('Server', node, [['name', 'myserv'],
['outputStreamRedirect', [['fileName', 'myfile.out']]]])
- Save the configuration changes.
The wsadmin tool uses the workspace to hold configuration changes. You must save your changes to transfer the updates to the master configuration repository. If a scripting process ends and you have not saved your changes, the changes are discarded.
Procedure
Use the following commands to save the configuration changes: - Using Jacl:
$AdminConfig save
- Using Jython:
AdminConfig.save()
where:
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
save | is an AdminConfig command |
If you are using interactive mode with the wsadmin tool, you will be prompted to save your changes before they are discarded.
If you are using the -c option with the wsadmin tool, changes are automatically saved. On a Unix operating system, if you invoke a command that includes a dollar sign character ($) using the wsadmin -c option, the command line attempts to substitute a variable. To avoid this problem, escape the dollar sign character with a backslash character (\). For example: wsadmin -c "\$AdminConfig save".
If a scripting process ends and no save has been performed, any configuration changes made since the last save are discarded. If there are multiple clients (scripts or browser clients) updating the configuration at the same time, it is possible that the changes requested by a script may not be saved. If this happens, you will receive an exception and you must make the updates again. If the save fails, the updates will not be saved to the configuration. If it succeeds, all updates are saved. To avoid save failures, you can invoke the save command after every configuration update.
You can use the reset command of the AdminConfig object to undo changes that you made to your configuration since your last save.
4.In a network deployment environment only, synchronize the node.
A node synchronization is necessary in order to propagate configuration changes to the affected node or nodes. By default, this situation occurs periodically, as long as the node can communicate with the deployment manager. You can propagate changes explicitly by performing the following steps:
Procedure
- Set the variable for node synchronization. where:
set | is a Jacl command |
Sync1 | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans running in a WebSphere Application Server process |
completeObjectName | is an AdminControl command |
type=NodeSync,node=myNodeName | is a fragment of the object name. The complete name is returned by this command. This fragment is used to find the matching object name which is the SyncNode object for the myNodeName node, where myNodeName is the name of the node that you use to synchronize configuration changes. For example: type=Server, name=serv1. It can be any valid combination of domain and key properties. For example, type, name, cell, node, process, and so on. |
Example output:
WebSphere:platform=common,cell=myNetwork,version=5.0,name=node
Sync,mbeanIdentifier=nodeSync,type=NodeSync,node=myBaseNode,
process=nodeagent
- Synchronize the node by issuing the following command: where:
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans that run in a WebSphere Application Server process |
invoke | is an AdminControl command |
Sync1 | evaluates the ID of the server that is specified in step number 1 |
sync | is an attribute of modify command |
Example output:
true
You receive an output value of
true, if the synchronization completes.