Changing the application server configuration using the wsadmin tool
You can use the wsadmin AdminConfig and AdminApp objects to make changes to the application server configuration.
About this task
Procedure
- wsadmin 스크립트 도구를 시작하십시오.
For this task, connect the wsadmin scripting client to the deployment manager server in a network deployment environment.
- Set a variable for creating a server:
Using Jacl:
set n1 [$AdminConfig getid /Node:mynode/]
- Using Jython:
n1 = AdminConfig.getid('/Node:mynode/')
Table 1. AdminConfig getid command description. The following table describes the AdminConfig getid command. Element Description set is a Jacl command n1 is a variable name $ is a Jacl operator for substituting a variable name with its value AdminConfig is an object that represents the WebSphere® Application Server configuration getid is an AdminConfig command Node is the object type mynode is the name of the object to modify - Create a server with the following command:
Using Jacl:
set serv1 [$AdminConfig create Server $n1 {{name myserv}}]
- Using Jython list:
serv1 = AdminConfig.create('Server', n1, [['name', 'myserv']])
- Using Jython string:
serv1 = AdminConfig.create('Server', n1, '[[name myserv]]')
After this command completes, some new files can be seen in a workspace used by the deployment manager server on behalf of this scripting client. A workspace is a temporary repository of configuration information that administrative clients use. Any changes made to the configuration by an administrative 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 WebSphere Application Server installation.Table 2. AdminConfig create command description. The following table describes the AdminConfig create command. Element Description set is a Jacl command serv1 is a variable name $ is a Jacl operator for substituting a variable name with its value AdminConfig is an object that represents the WebSphere Application Server configuration create is an AdminConfig command Server is an AdminConfig object n1 evaluates to the ID of the host node that is specified in step number 1 name is an attribute myserv is the value of the name attribute - Make a configuration change to the server with the following
command:
Using Jacl:
$AdminConfig modify $serv1 {{stateManagement {{initialState STOP}}}}
- Using Jython list:
AdminConfig.modify(serv1, [['stateManagement', [['initialState', 'STOP']]]])
- Using 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.Table 3. AdminConfig modify command description. The following table describes the AdminConfig modify command. Element Description $ is a Jacl operator for substituting a variable name with its value AdminConfig is an object that represents the WebSphere Application Server configuration modify is an AdminConfig command serv1 evaluates to the ID of the host node that is specified in step number 2 stateManagement is an attribute initialState is a nested attribute within the stateManagement attribute STOP is the value of the initialState attribute - Save the configuration changes. 다음 명령 예제를 사용하여 구성 변경사항을 저장하십시오.
AdminConfig.save()
- In a network deployment environment
only, synchronize the node. AdminNodeManagement 스크립트 라이브러리에 있는 syncActiveNode 또는 syncNode 스크립트를 사용하여 구성 변경사항을 노드에 전파하십시오.
- 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여
변경사항을 셀 내의 각 노드에 전파하십시오.
AdminNodeManagement.syncActiveNodes()
- 다음 명령 데모에 표시된 것과 같이, syncNode 스크립트를 사용하여
변경사항을 특정 노드에 전파하십시오.
AdminNodeManagement.syncNode("myNode")
- 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여
변경사항을 셀 내의 각 노드에 전파하십시오.
Related tasks:
Related reference:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_configchange
파일 이름:txml_configchange.html