Configuring the Java virtual machine using scripting

Use the wsadmin tool to configure settings for a Java™ virtual machine (JVM). As part of configuring an application server, you might define settings that enhance the way your operating system uses of the Java virtual machine.

About this task

There are three ways to perform this task. Use the steps in this topic to use the setJVMDebugMode command for the AdminTask object or the AdminConfig object to modify your JVM configuration. Alternatively, you can use the configureJavaVirtualMachine Jython script in the AdminServerManagement script library to enable, disable, or configure the debug mode for the JVM. The wsadmin tool automatically loads the script when the tool starts. Use the following syntax to configure JVM settings using the configureJavaVirtualMachine script:
AdminServerManagement.configureJavaVirtualMachine(nodeName, serverName, debugMode, debugArgs, otherAttributeList)
For additional information and argument definitions, see the documentation for the AdminServerMananagment script library.

The Java virtual machine (JVM) is an interpretive computing engine responsible for running the byte codes in a compiled Java program. The JVM translates the Java byte codes into the native instructions of the host machine. The application server, being a Java process, requires a JVM in order to run, and to support the Java applications running on it. JVM settings are part of an application server configuration.

Procedure

  1. wsadmin 스크립트 도구를 시작하십시오.
  2. There are two ways to complete this step. You can use the setJVMDebugMode command for the AdminTask object or the AdminConfig object to modify your JVM configuration. Choose one of the following configuration methods:
    • Using the AdminTask object:
      • Using Jacl:
        $AdminTask setJVMDebugMode {-serverName server1 -nodeName node1 -debugMode true}
      • Using Jython:
        AdminTask.setJVMDebugMode (['-serverName', 'server1', '-nodeName', 'node1', '-debugMode', 'true'])
    • Using the AdminConfig object:
      1. Identify the server and assign it to the server1 variable, as the following example demonstrates:
        • Using Jacl:
          set server1 [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
        • Using Jython:
          server1 = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
          print server1
        Example output:
        server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
      2. Identify the JVM that belongs to the server of interest and assign it to the jvm variable, as the following example demonstrates:
        • Using Jacl:
          set jvm [$AdminConfig list JavaVirtualMachine $server1]
        • Using Jython:
          jvm = AdminConfig.list('JavaVirtualMachine', server1)
          print jvm

        Example output:

        [AIX Solaris HP-UX Linux Windows][IBM i]
        (cells/mycell/nodes/mynode/servers/server1:server.xml#JavaVirtualMachine_1)
        [z/OS]
        (cells/mycell/nodes/mynode/servers/server1:server.xml#JavaVirtualMachine_1)
        (cells/mycell/nodes/mynode/servers/server1:server.xml#JavaVirtualMachine_2)
      3. [z/OS]Identify the controller JVM of the server and its servant region JVM, as the following example demonstrates:
        • Using Jacl:
          set cjvm [lindex $jvm 0]
          set sjvm [lindex $jvm 1]
        • Using Jython:
          # get line separator
          import java
          lineSeparator = java.lang.System.getProperty('line.separator')
          arrayJVMs = jvm.split(lineSeparator)
          cjvm = arrayJVMs[0]
          sjvm = arrayJVMs[1]
      4. Modify the JVM to enable debugging, as the following example demonstrates:
        • Using Jacl:[AIX Solaris HP-UX Linux Windows][IBM i]
          $AdminConfig modify $jvm {{debugMode true} {debugArgs "-Djava.compiler=NONE -Xdebug -Xnoagent 
          -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777"}}
          [z/OS]
          $AdminConfig modify $cjvm {{debugMode true} {debugArgs "-Djava.compiler=NONE -Xdebug -Xnoagent 
          -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777"}}
          $AdminConfig modify $sjvm {{debugMode true} {debugArgs "-Djava.compiler=NONE -Xdebug -Xnoagent 
          -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777"}}
        • Using Jython:[AIX Solaris HP-UX Linux Windows][IBM i]
          AdminConfig.modify(jvm, [['debugMode', 'true'], ['debugArgs',  "-Djava.compiler=NONE -Xdebug 
          -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777"]])
          [z/OS]
          AdminConfig.modify(cjvm, [['debugMode', 'true'], ['debugArgs',  "-Djava.compiler=NONE -Xdebug 
          -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777"]])
          AdminConfig.modify(sjvm, [['debugMode', 'true'], ['debugArgs',  "-Djava.compiler=NONE -Xdebug 
          -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777"]])
  3. Save the configuration changes.
    다음 명령 예제를 사용하여 구성 변경사항을 저장하십시오.
    AdminConfig.save()
  4. In a network deployment environment only, synchronize the node.
    AdminNodeManagement 스크립트 라이브러리에 있는 syncActiveNode 또는 syncNode 스크립트를 사용하여 구성 변경사항을 노드에 전파하십시오.
    • 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여 변경사항을 셀 내의 각 노드에 전파하십시오.
      AdminNodeManagement.syncActiveNodes()
    • 다음 명령 데모에 표시된 것과 같이, syncNode 스크립트를 사용하여 변경사항을 특정 노드에 전파하십시오.
      AdminNodeManagement.syncNode("myNode")

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: July 9, 2016 6:14
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_jvm
파일 이름:txml_jvm.html