0
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で設定し、設定できたことを確認する(JVM編)

Last updated at Posted at 2021-11-20

まぁアプリケーションサーバヒープサイズと起動引数は絶対現場ではそれぞれ設定するかと思います。
設定値を変数渡しをしたい場合はこちらのコードを参照してください。
※いつか直します。。。
https://qiita.com/XKYUXSOX/items/7f33c1ee19827030f0a7

JVM_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('JavaVirtualMachine',id)
      print nodename + servername
      AdminConfig.modify(ProcessID,'[[initialHeapSize "256"]]')
      AdminConfig.modify(ProcessID,'[[maximumHeapSize "256"]]')
      AdminConfig.modify(ProcessID,'[[genericJvmArguments "-Djava.awt.headless=true,-verbose gc"]]')

AdminConfig.save()

設定がきちんとできたことを確認する。

JVM_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('JavaVirtualMachine',id)
      print nodename + servername
      print AdminConfig.showAttribute(ProcessID,'initialHeapSize')
      print AdminConfig.showAttribute(ProcessID,'maximumHeapSize')
      print AdminConfig.showAttribute(ProcessID,'genericJvmArguments')

0
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
0
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?