Change the appserver configuration using wsadmin


 

+

Search Tips   |   Advanced Search

 

Use the wsadmin AdminConfig and AdminApp objects to make changes to the appserver configuration.

The purpose of this article is to illustrate the relationship between the commands that are used to change the configuration and the files that are used to hold configuration data. This discussion assumes that we have a network deployment installation, but the concepts are very similar for a appserver installation.

For this task, connect the wsadmin scripting client to the dmgr server in a network deployment environment.

Jython example...

### Set a variable for creating a server:
n1 = AdminConfig.getid('/Node:mynode/')

### Create a server
serv1 = AdminConfig.create('Server', n1, [['name', 'myserv']])

### Use Jython string:
### serv1 = AdminConfig.create('Server', n1, '[[name myserv]]')

### After this command completes, some new files can seen in a workspace used by the
### dmgr server on behalf of this scripting client. A workspace is a temporary repository
### of configuration information that admin clients use. Any changes made to the
### configuration by an admin client are first made to this temporary workspace.
###
### For scripting, when a save command is invoked on the AdminConfig object,
### these changes are transferred to the real configuration repository. Workspaces
### are kept in the wstemp subdirectory of a WAS installation.

### Make configuration change to the server
AdminConfig.modify(serv1, [['stateManagement', [['initialState', 'STOP']]]])

### Jython string:
### AdminConfig.modify(serv1, '[[stateManagement [[initialState STOP]]]]')

### This command changes the initial state of the new server. After this command completes,
### one of the files in the workspace is changed.

AdminConfig.save()
AdminNodeManagement.syncActiveNodes()

### To specify node for sync
### AdminNodeManagement.syncNode("myNode")

Jacl example...

### Set a variable for creating a server:
set n1 [$AdminConfig getid /Node:mynode/]

### Create a server
set serv1 [$AdminConfig create Server $n1 {{name myserv}}]

### Make configuration change to the server
$AdminConfig modify $serv1 {{stateManagement {{initialState STOP}}}}

 

Related tasks

Use the script library to automate the application serving environment
Use the AdminConfig object for scripted administration

 

Related


Commands for the AdminConfig object