2012년 2월 21일 화요일

[WebSphere] Using wsadmin to update a plug-in property

 Using wsadmin to update a plug-in property

Question

How do I modify a plug-in property without using the WebSphere Application Server administrative console?

Cause

You want to write a script to disable automatic plug-in generation.

Answer


These steps below will disable automatic plug-in generation for a Web server.

  1. Navigate to <app_server_root>/bin

  2. ./wsadmin

  3. $AdminConfig getid /Node:yourNodeName/Server:yourWebServerName

    [If there is only one Web server or just few Web servers, you may skip this step. It should be easy to identify the Web server from the list generated from the next step.]

  4. $AdminConfig list PluginProperties

    [This will produce a list of Web servers' PluginProperties IDs. Determine the one that references the name given in Step 3. Use the entire name including the start and end parenthesis.]

  5. $AdminConfig showall (cells/yourCellName/nodes/yourNodeName/servers/yourWebServerName|server.xml#PluginProperties_ID)

    [This will show all plug-in properties for a Web server. It's optional if you know the property name.]
    [(cells/yourCellName....) is the ID pulled from the output of step 4.]

  6. $AdminConfig modify (cells/yourCellName/nodes/yourNodeName/servers/yourWebServerName|server.xml#PluginProperties_ID) "{PluginGeneration {MANUAL}}”

    [(cells/yourCellName....) is the same ID used in step 5 or pulled from the output of step 4 if you skipped step 5.]

  7. $AdminConfig save

  8. $AdminConfig showall (cells/yourCellName/nodes/yourNodeName/servers/yourWebServerName|server.xml#PluginProperties_ID)

    [Again, it is an optional step. This step will help verify the change made in step 6.]


Here is a WAS ND 7.0 example of running the above steps on Windows: (Commands are in Italic.)
Step 1. Navigate to a folder where wsadmin.bat resides.
C:\Documents and Settings\Administrator>cd "\Program Files\IBM\WebSphere\ND70\bin"

C:\Program Files\IBM\WebSphere\ND70\bin>

Step 2. Run wsadmin.
C:\Program Files\IBM\WebSphere\ND70\bin>wsadmin
WASX7209I: Connected to process "dmgr" on node IBM-9ED43ACF522CellManager03 using SOAP connector; The type of process is: DeploymentManager
WASX7029I: For help, enter: "$Help help"
wsadmin>

Step 3. Get Web server ID. (Optional. This example has only two Web servers. It's easy to tell which plug-in properties ID is for which Web server.)
wsadmin>$AdminConfig getid /Node:IBM-9ED43ACF522Node03/Server:webserver1
webserver1(cells/IBM-9ED43ACF522Cell03/nodes/IBM-9ED43ACF522Node03/servers/webse
rver1|server.xml#Server_1280237404937)

Step 4. List plug-in properties IDs.
wsadmin>$AdminConfig list PluginProperties
(cells/IBM-9ED43ACF522Cell03/nodes/IBM-9ED43ACF522Node03/servers/webserver1|serv
er.xml#PluginProperties_1280237404937)
(cells/IBM-9ED43ACF522Cell03/nodes/Unmanaged-node/servers/Apache22|server.xml#Pl
uginProperties_1280237595312)

Step 5. Show all plug-in properties.
wsadmin>$AdminConfig showall (cells/IBM-9ED43ACF522Cell03/nodes/IBM-9ED43ACF522Node03/servers/webserver1|server.xml#PluginProperties_1280237404937)
{ASDisableNagle false}
{AcceptAllContent false}
{AppServerPortPreference HOSTHEADER}
{ChunkedResponse false}
{ConfigFilename plugin-cfg.xml}
{ESIEnable true}
{ESIInvalidationMonitor false}
{ESIMaxCacheSize 1024}
{IISDisableNagle false}
{IISPluginPriority HIGH}
{IgnoreDNSFailures false}
{KeyRingFilename plugin-key.kdb}
{LogFilename "C:\Program Files\IBM\IHS70\Plugins\logs\webserver1\http_plugin.log"}
{LogLevel ERROR}
{PluginGeneration AUTOMATIC}
{PluginInstallRoot "C:\Program Files\IBM\IHS70\Plugins"}
{PluginPropagation AUTOMATIC}
{RefreshInterval 60}
{RemoteConfigFilename "C:\Program Files\IBM\IHS70\Plugins\config\webserver1\plugin-cfg.xml"}
{RemoteKeyRingFilename "C:\Program Files\IBM\IHS70\Plugins\config\webserver1\plugin-key.kdb"}
{ResponseChunkSize 64}
{VHostMatchingCompat false}
{pluginServerClusterProperties {{CloneSeparatorChange false}
{LoadBalance ROUND_ROBIN}
{PostBufferSize 64}
{PostSizeLimit -1}
{RemoveSpecialHeaders true}
{RetryInterval 60}}}
{properties {}}

Step 6. Change PluginGeneration property for webserver1 to MANUAL. (See the highlighted property above.)
wsadmin>$AdminConfig modify (cells/IBM-9ED43ACF522Cell03/nodes/IBM-9ED43ACF522No
de03/servers/webserver1|server.xml#PluginProperties_1280237404937) "{PluginGener
ation {MANUAL}}"

Step 7. Save the change
wsadmin>$AdminConfig save

Step 8. Repeat step 5 to verify the PluginGeneration property is changed.
.....
{PluginGeneration MANUAL}
.....

This technote presents an example of using commands to update plug-in configuration generation property (PluginGeneration). The same steps can be used to modify other plug-in properties.

Related information

wsadmin tool

댓글 없음:

댓글 쓰기