Set processes using scripting


 

+

Search Tips   |   Advanced Search

 

Use wsadmin to configure appserver processes.

Process definition settings define runtime properties such as...

There are three ways to perform this task.

To configure process definition settings using configureProcessDefinition:

AdminServerManagement.configureProcessDefinition(nodeName, serverName, otherParamList)

To configure process definition settings using setProcessDefinition...

### Jacl
$AdminTask setProcessDefinition {-interactive}

### Jython
AdminTask.setProcessDefinition (['-interactive'])

To configure process definitions with AdminConfig...

### Jacl...

### Identify the server and assign it to the s1 variable...
set s1 [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]

### Identify the process definition for the server of interest, and assign
### it to the processDef variable...
set processDef [$AdminConfig list Java ProcessDef $s1]
set processDef [$AdminConfig showAttribute $s1 processDefinitions]

### Modify the configuration attributes for the process definition.

### Change the working directory
$AdminConfig modify $processDef {{workingDirectory c:/temp/user1}}

### Modify the name of the stderr file
set errFile [list stderrFilename \${LOG_ROOT}/server1/new_stderr.log]
set attr [list $errFile]
$AdminConfig modify $processDef [subst {{ioRedirect {$attr}}}]

### Modify the process priority level:
$AdminConfig modify $processDef {{execution {{processPriority 15}}}}

### Change the maximum startup attempts.
### We can modify this example to change other attributes
### in the process definition object.
$AdminConfig modify $processDef {{monitoringPolicy {{maximumStartupAttempts 1}}}}



### Jython...
s1 = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
print s1

processDef = AdminConfig.list('Java ProcessDef', s1)
print processDef
processDef = AdminConfig.showAttribute(s1, 'processDefinitions')
AdminConfig.modify(processDef, [['workingDirectory', 'c:/temp/user1']])
errFile = ['stderrFilename', '\${LOG_ROOT}/server1/new_stderr.log']
attr = [errFile]
AdminConfig.modify(processDef, [['ioRedirect', [attr]]])
AdminConfig.modify(processDef, [['execution', [['processPriority', 15]]]])
AdminConfig.modify(processDef, [['monitoringPolicy', [['maximumStartupAttempts', 1]]]])
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()
AdminNodeManagement.syncNode("myNode")

 

Related tasks

Define appserver processes
Use the AdminConfig object for scripted administration

 

Related

Process definition settings
Server settings configuration scripts
Node administration scripts
Commands for the AdminConfig object