第4回 wsadminコマンドで楽々設定&情報採取 WebSphere Application Server その2
Tweet
第4回は、第3回で実施したコマンドラインでの設定、情報採取をさらに改良してみます。
第2回のアプリケーションサーバー構築時と同様にservername の値をserver_listから取り出し、for文で回すことで、複数のアプリケーションサーバーに同じ設定を実施できます。設定完了後、設定情報を取得してみます。
appserver01については第3回で設定済みのため、今回はappserver02~05について設定を行います。
server_list = ('appserver02','appserver03','appserver04','appserver05')
for servername in server_list:
nodename="testNode01"
server=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
javavirtualmachine=AdminConfig.list("JavaVirtualMachine", server)
verbosemodegarbagecollection="true"
initialheapsize=str("1024")
maximumheapsize=str("1024")
AdminConfig.modify(javavirtualmachine, "[[initialHeapSize "+initialheapsize+"] [maximumHeapSize "+maximumheapsize+"] [verboseModeGarbageCollection "+verbosemodegarbagecollection+"]]")
AdminConfig.save()
server_list = ('appserver02','appserver03','appserver04','appserver05')
for servername in server_list:
print "----------"+servername+"----------"
nodename="testNode01"
server=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
javavirtualmachine=AdminConfig.list("JavaVirtualMachine", server)
print AdminConfig.show(javavirtualmachine)
wsadmin>
wsadmin>server_list = ('appserver02','appserver03','appserver04','appserver05')
wsadmin>
wsadmin>for servername in server_list:
wsadmin> nodename="testNode01"
wsadmin> server=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
wsadmin> javavirtualmachine=AdminConfig.list("JavaVirtualMachine", server)
wsadmin> verbosemodegarbagecollection="true"
wsadmin> initialheapsize=str("1024")
wsadmin> maximumheapsize=str("1024")
wsadmin> AdminConfig.modify(javavirtualmachine, "[[initialHeapSize "+initialheapsize+"] [maximumHeapSize "+maximumheapsize+"] [verboseModeGarbageCollection "+verbosemodegarbagecollection+"]]")
wsadmin>
AdminConfig.save()
''
''
''
''
wsadmin>wsadmin>''
wsadmin>wsadmin>
wsadmin>
wsadmin>server_list = ('appserver02','appserver03','appserver04','appserver05')
wsadmin>
wsadmin>for servername in server_list:
wsadmin> print "----------"+servername+"----------"
wsadmin> nodename="testNode01"
wsadmin> server=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
wsadmin> javavirtualmachine=AdminConfig.list("JavaVirtualMachine", server)
wsadmin> print AdminConfig.show(javavirtualmachine)
wsadmin>
----------appserver02----------
[bootClasspath []]
[classpath []]
[debugArgs -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777]
[debugMode false]
[disableJIT false]
[genericJvmArguments []]
[hprofArguments []]
[initialHeapSize 1024]
[internalClassAccessMode ALLOW]
[maximumHeapSize 1024]
[runHProf false]
[systemProperties [com.ibm.security.jgss.debug(cells/testCell01/nodes/testNode01/servers/appserver02|server.xml#Property_xxxxxxxx) com.ibm.security.krb5.Krb5Debug(cells/testCell01/nodes/testNode01/servers/appserver02|server.xml#Property_xxxxxxxx)]]
[verboseModeClass false]
[verboseModeGarbageCollection true]
[verboseModeJNI false]
----------appserver03----------
[bootClasspath []]
[classpath []]
[debugArgs -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777]
[debugMode false]
[disableJIT false]
[genericJvmArguments []]
[hprofArguments []]
[initialHeapSize 1024]
[internalClassAccessMode ALLOW]
[maximumHeapSize 1024]
[runHProf false]
[systemProperties [com.ibm.security.jgss.debug(cells/testCell01/nodes/testNode01/servers/appserver03|server.xml#Property_xxxxxxxx) com.ibm.security.krb5.Krb5Debug(cells/testCell01/nodes/testNode01/servers/appserver03|server.xml#Property_xxxxxxxx)]]
[verboseModeClass false]
[verboseModeGarbageCollection true]
[verboseModeJNI false]
----------appserver04----------
[bootClasspath []]
[classpath []]
[debugArgs -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777]
[debugMode false]
[disableJIT false]
[genericJvmArguments []]
[hprofArguments []]
[initialHeapSize 1024]
[internalClassAccessMode ALLOW]
[maximumHeapSize 1024]
[runHProf false]
[systemProperties [com.ibm.security.jgss.debug(cells/testCell01/nodes/testNode01/servers/appserver04|server.xml#Property_xxxxxxxx) com.ibm.security.krb5.Krb5Debug(cells/testCell01/nodes/testNode01/servers/appserver04|server.xml#Property_xxxxxxxx)]]
[verboseModeClass false]
[verboseModeGarbageCollection true]
[verboseModeJNI false]
----------appserver05----------
[bootClasspath []]
[classpath []]
[debugArgs -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777]
[debugMode false]
[disableJIT false]
[genericJvmArguments []]
[hprofArguments []]
[initialHeapSize 1024]
[internalClassAccessMode ALLOW]
[maximumHeapSize 1024]
[runHProf false]
[systemProperties [com.ibm.security.jgss.debug(cells/testCell01/nodes/testNode01/servers/appserver05|server.xml#Property_xxxxxxxx) com.ibm.security.krb5.Krb5Debug(cells/testCell01/nodes/testNode01/servers/appserver05|server.xml#Property_xxxxxxxx)]]
[verboseModeClass false]
[verboseModeGarbageCollection true]
[verboseModeJNI false]
wsadmin>wsadmin>
これで複数のアプリケーションサーバーのJVMのメモリ設定をコマンドで変更し、設定した値の情報採取が行うことができます。複数のアプリケーションサーバーを同じ設定とする場合に、是非参考にしていただければと思います。
第4回では第3回に引き続き、コマンドラインでのアプリケーションサーバーの設定、情報採取の方法についてご説明しました。
第5回ではwsadminコマンドを利用したアプリケーションのデプロイについて触れたいと思います。
Tweet