1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

wsadminで設定し、設定できたことを確認する(webcontainer編)

Last updated at Posted at 2021-11-20

webcontainerの場合の設定方法と設定確認方法

wsadminの問題なのか知らないが、AdminConfig.list()で取得するID後に
改行コードがあったりなかったりしてIDとして使用できるまでに色々設定がいる。
※うまい日本語化できなくてごめんなさい。

今回はwebthread数を設定する場合
参考サイト
https://stackoverflow.com/questions/30603818/modify-the-thread-pool-in-websphere-8-5-using-wsadmin-script

jvminfo.txt
yyy1Node01,server1
yyy1Node01,server2
yyy2Node01,server1

設定方法

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/wsadmin.sh -lang jython -user wasadmin -password wasadmin -f Webthread_set.py

設定値を変数渡しをしたい場合はこちらのコードを参照してください。
※いつか直します。。。
https://qiita.com/XKYUXSOX/items/7f33c1ee19827030f0a7

Webthread_set.py

import csv

with open('jvminfo.txt') as f:
    csvreader = csv.reader(f)
    for row in csvreader:
      nodename=row[0]
      servername=row[1]
      id=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
      ProcessID = AdminConfig.list('ThreadPool',id)
      threadPoolList=AdminUtilities.convertToList(ProcessID)
      for thd in threadPoolList:
        if AdminConfig.showAttribute(thd,'name') == 'WebContainer':
           print nodename + servername
           AdminConfig.modify(thd,'[[maximumSize "70"]]')
           AdminConfig.modify(thd,'[[minimumSize "30"]]')
           AdminConfig.save()

設定確認方法

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/wsadmin.sh -lang jython -user wasadmin -password wasadmin -f Webthread_get.py

Webthread_get.py
import csv

with open('jvminfo.txt') as f:
    csvreader = csv.reader(f)
    for row in csvreader:
      nodename=row[0]
      servername=row[1]
      id=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
      ProcessID = AdminConfig.list('ThreadPool',id)
      threadPoolList=AdminUtilities.convertToList(ProcessID)
      for thd in threadPoolList:
        if AdminConfig.showAttribute(thd,'name') == 'WebContainer':
           print nodename + servername
           print AdminConfig.showAttribute(thd,'name')
           print AdminConfig.showAttribute(thd,'maximumSize')
           print AdminConfig.showAttribute(thd,'maximumSize')
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?