设置可用的 MBean 属性

许多 CM Server 属性都可以通过设置 MBean 属性进行修改。本主题描述 MBean 属性以及如何设置这些属性。

属性按其驻留的 MBean 进行分类。所有参数都可以检索并且以 [R] 表示可以读取。可以更改的参数以 [W] 表示可以写入。可使用 WebSphere® wsadmin 命令行实用程序来通过 JACL 命令访问属性。teamAdminUtils.jacl 文件了提供 JACL 命令、语法和功能的示例。

仅当 CM Server 正在运行时才能更改可设置的参数;由于更改是实时可见的,所以无需重新启动服务器。对管理后端 ONCRPC 服务器进程启动的 MBean 属性的更改不会影响已启动的后端 ONCRPC 进程;只有新近启动的后端 ONCRPC 服务器进程才会采用新设置。

在 CM Server 启动时将创建三个 MBean:TeamServerMBean(容纳 CM Server 范围内的配置属性)、CcServerFactoryMBean(容纳 ClearCase Managed Connection Factory 属性)和 CqServerFactoryMBean(容纳 ClearQuest Managed Connection Factory 属性)。每个 MBean 代表 CM Server 中不同的可配置实体。

受管连接工厂是负责启动后端 ONCRPC 服务器进程的 CM Server 组件。这些后端进程将连接桥接至特定于 ClearCase 和 ClearQuest 的核心产品。

ClearCase Managed Connection Factory 启动单线程的 ClearCase ONCRPC 后端服务器进程,每个进程称为单个 ccrpc 进程。 一个进程是为一组特定凭证而启动的,并且它将为该组凭证提供服务,直到不再需要此进程后才会结束进程。由于 ccrpc 进程是单线程进程,所以每个 ccrpc 进程保持活动状态的时间会比较短。ClearCase Managed Connection Factory 将自动对每个 ccrpc 进程进行生命周期管理。

ClearQuest Managed Connection Factory 启动一个(也可能是多个)多线程的 ClearQuest ONCRPC 后端服务器进程,每个进程称为 cqrpc 进程。由于 cqrpc 进程是多线程进程,可以处理来自多个不同凭证的请求,因此 cqrpc 进程占用的资源会更多,且保持活动状态的时间也比 ccrpc 后端进程更长。ClearQuest Managed Connection Factory 将自动对每个 cqrpc 进程进行生命周期管理。

有关 CM Server 受管连接工厂生命周期管理的更多信息,请参阅CM Server 受管连接工厂生命周期管理

CM Server 包括以下 MBean。

wsadmin 示例

以下示例说明了用于启动和使用 wsadmin 实用程序的基于 JACL 的命令。
  • // Enter commands like the following to start up the wsadmin utility.  Your wsadmin utility is 
    // located in a directory such as "C:\Program Files\IBM\RationalSDLC\common\CM\scripts" on Windows
    // or "/opt/IBM/RationalSDLC/common/CM/scripts" on UNIX, or "/opt/ibm/RationalSDLC/common/CM/scripts" on Linux.
    
    # cd <to the directory containing JACL scripts>
    // For Windows:
    # set WAS_BIN="C:\Program Files\IBM\RationalSDLC\common\CM\profiles\cmprofile\bin"  
    // For UNIX: 
    # set WAS_BIN=/opt/IBM/RationalSDLC/common/CM/profiles/cmprofile/bin
    // For Linux: 
    # set WAS_BIN=/opt/ibm/RationalSDLC/common/CM/profiles/cmprofile/bin
    
    
    // For Windows:
    # %WAS_BIN%\wsadmin
    // For UNIX:
    # $WAS_BIN/wsadmin.sh
    
    
    // This wsadmin command loads several useful functions that are available for you to use:
    wsadmin> source teamAdminUtils.jacl
    
    // This command shows an example of how to display some useful commands. The getTeamServer 
    // function is  useful for establishing a pointer to the top level TeamServerMBean, and will help 
    // get and set individual TeamServerMBean attributes.
    
    wsadmin> info proc *Team*
        startTeamEAR stopTeamEAR getTeamServer
    
    // This command displays the available 'dump' commands for quick and easy viewing of the MBean 
    // values:
    wsadmin> info proc dump*
    
       dumpAllServers dumpAll dumpTeamServer dumpCcServers dumpCqServerFactory 
       dumpCcServerFactory dumpCqServers
    
    
    // This command 'uses' the convenience command 'getTeamServer' to set up the 
    // variable 't' that can then be used to access TeamServerMBean attributes:
    wsadmin> set t [getTeamServer]
    
    // Retrieve the TeamServerMBean attribute values using the variable 't':
    wsadmin> $AdminControl getAttributes $t
    
    {cqServerFactory WebSphere:cell=testhost2Node01Cell,version=6.1.0.0,spec=1.0,name=CqServerFactoryMBeanId,
        mbeanIdentifier=CqServerFactoryMBeanId,type=stp.management.CqServerFactoryMBean,node=testhost2Node01,
        process=server1}
    
    {ccrcUseViewHostPathForGlobalPath false}
    {oncrpcBufferLimit 100}
    {cqLoginSessionWaitTimeout 120}
    {oncrpcInterruptLimit 1000}
    {ccrcUnixCqHome {
    {sessionReaperThreadDelay 900}
    {ccrcUserRegionMapfile {
    {ccrcTempDir {
    {ccrcTraceSubsystem {
    {sessionQueryObjectTimeout 1800}
    {oncrpcServers {
    {cqLoginSessionTimeout 1800}
    {cqFulltextSearchRecordHitLimit 200}
    {ejbBufferLimit 100}
    {ccrcVobLineTerminator {
    {sessionRecordObjectTimeout 10800}
    {cqFulltextSearchPageSize 25}
    {numberOfActiveSessions 0}
    {ccServerFactory WebSphere:cell=testhost2Node01Cell,version=6.1.0.0,spec=1.0,name=CcServerFactoryMBeanId,
        mbeanIdentifier=CcServerFactoryMBeanId,type=stp.management.CcServerFactoryMBean,node=testhost2Node01,
        process=server1}
    {sessionObjectDefaultTimeout 1800}
    {ccrcUploadLimit 0}
    {maxProcureServerAttempts 6}
    {cqFulltextSearchCacheSize 1000}
    {ccrcTraceLevel 0}
    {maxCqSessionsPerUser 2}
    {ccrcLoginSessionTimeout 900}
    {totalNumberOfOncrpcServers 0}
    {ccrcViewStorage {
    {numberOfHttpSessionsCreated 0}
    {ccrcPrimaryGroup {
    {procureServerInterval 60}
    
    
    
    // Another (more convenient) way to retrieve all of the TeamServerMBean attributes is:
    wsadmin> dumpTeamServer
    
    TeamServerMBean Attributes:
    ====================
    
    {cqServerFactory WebSphere:cell=testhost2Node01Cell,version=6.1.0.0,spec=1.0,name=CqServerFactoryMBeanId,
        mbeanIdentifier=CqServerFactoryMBeanId,type=stp.management.CqServerFactoryMBean,node=testhost2Node01,
        process=server1}
    
    {ccrcUseViewHostPathForGlobalPath false}
    . . .
    
    
    // This command sets up the variable 'cc' for accessing the ccServerFactory MBean 
    // attributes. Note that the variable 't' defined in a previous command is used to 
    // obtain a pointer to the TeamServerMBean's ccServerFactory attribute value; the
    // variable 'cc' can then be used to access the attributes in the CcServerFactoryMBean:
    wsadmin> set cc [$AdminControl getAttribute $t ccServerFactory]
    
    // Another (more convenient) way to set up the variable 'cc' is:
    wsadmin>set cc [getCcServerFactory]
    
    
    // Other 'get' convenience commands include: getCcServerFactory, getCqServerFactory, 
    // getTeamServer and getOncrpcServers.
    
    
    // This command retrieves the CcServerFactoryMBean attribute values using the 'cc' variable 
    // defined above:
    wsadmin> $AdminControl getAttributes $cc
        {oncrpcCallThreshold 5000}
        {idleServerInterval 600}
        {serverThresholdCount 50}
        {maxServersPerCredential 5}
        {maxServerCount 200}
        {interactionRequestTimeout 300}
        {busyServerPossiblyIdleLimit 14400}
    
    // This command sets the maxServerCount MBean attribute that is defined in the 
    // CcServerFactoryMBean, referenced using the 'cc' variable defined in a previous command:
    wsadmin> $AdminControl setAttribute $cc maxServerCount 101
    
    
    // This command sets up the variable 'cq' for accessing the CqServerFactoryMBean attributes. 
    // Note that the variable 't' defined in a previous command is used to obtain a pointer to the 
    // TeamServerMBean's cqServerFactory attribute value; the variable 'cq' can then be used 
    // to access the attributes in the CqServerFactoryMBean:
    wsadmin> set cq [$AdminControl getAttribute $t cqServerFactory]
    
    // Another (more convenient) way to set up the variable 'cq' is:
    wsadmin>set cq [getCqServerFactory]
    
    // This command retrieves the CqServerFactoryMBean attribute values using the 'cq' variable
    // defined above:
    wsadmin> $AdminControl getAttributes $cq
    . . . 
    
    // This command sets up the variable 'os' to use for accessing the list of ONCRPC server MBeans,
    // each of which represents a specific ONCRPC backend server.  The command uses one of the 
    // convenience methods defined in the teamAdminUtils.jacl script that was 'sourced' at the 
    // beginning of this session:
    wsadmin> set os [$AdminControl invoke $t getOncrpcServers]  
            .   .   .   
    
            // A list of the running oncrpc backend servers is displayed. The first oncrpc server
            // is at index 0 (zero), the second is at index 1, and so on...
    
    
    // This command sets up the variable 'o' to use for accessing the first oncrpc server MBean 
    // displayed in the output from the above command. This level of MBean attribute access (i.e.,
    // specific oncrpc server MBeans) is tricky since the backend oncrpc server processes are 
    // transient and my be dismissed before you can access them.
    wsadmin> set o [getOnc 0]   // '0' is the index number of the first backend servers listed
                                           // in the output of the above command
    
    // This command retrieves the MBean attribute values for the CQ oncrpc server defined by the
    // variable 'o':
    wsadmin> $AdminControl getAttributes $o
            {workerThreadCount 16}  
            {serverState 1}
            {activeStatefulHttpSessions 0} 
            {port 3431} 
            {oncrpcCalls 7} 
            {recycleServerHttpSessionLimit 500} 
            {serverId {ClearQuest - 0
            {serverType ClearQuest} 
            {hostname testhost2}
            {activeHttpSessions 0} 
            {totalHttpSessions 1} 
    
    
    
    // These commands set and then get the recycleServerHttpSessionLimit attribute in the CQ 
    // oncrpc server defined by the variable 'o' above:
    wsadmin> $AdminControl setAttribute $o recycleServerHttpSessionLimit 501 
    
    wsadmin> $AdminControl getAttribute $o recycleServerHttpSessionLimit 501
    // These next commands set up and use the variable 'o' for accessing the second oncrpc server
    // MBean displayed in the output from the list of oncrpc servers obtained earlier.  In this example,
    // the desired CC ONCRPC server has already been dismissed by the CM Server lifecycle 
    
    // Management tasks:
    wsadmin> set o [getOnc 1] 
    
    wsadmin> $AdminControl getAttributes $o
        WASX7015E: Exception running command: "$AdminControl getAttributes $o"; exception information:
           com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String ""; cannot
           create ObjectName.
    
    // In the above command, the running CC oncrpc server process had already been cleaned up by the 
    // CM Server's lifecycle management task, thus the "WASX7015E:" error was displayed.  You will also
    // see this error if the index value you specify to the getOnc method is invalid (out of range).
    
    // The remaining commands show a few more oncrpc server MBean accesses and their output.
    // Remember that the list of ONCRPC servers is transient; using the dump commands such
    // as dumpCcServers, dumpCqServers, or dumpAllServers is much more convenient:
    
    wsadmin> set o [getOnc 1]
        WebSphere:cell=testhost2Node02Cell,version=6.1.0.0,spec=1.0,name=ClearCase - 15,
        mbeanIdentifier=ClearCase - 15,type=stp.management.CcOncrpcServerMBean, 
        node=testhost2Node02,process=server1
    
    wsadmin> $AdminControl getAttributes $o
            {serverType ClearCase}
            {serverState 1}
            {hostname testhost2}
            {port 4808}
    
    wsadmin> listOnc
           "WebSphere:cell=testhost2Node02Cell,version=6.1.0.0,spec=1.0,
           name=ClearQuest - 11,mbeanIdentifier=ClearQuest - 11, 
           type=stp.management.CqOncrpcServerMBean,node=testhost2Node02,
           process=server1"
           "WebSphere:cell=testhost2Node02Cell,version=6.1.0.0,spec=1.0,
           name=ClearCase - 14,mbeanIdentifier=ClearCase - 14,  
           type=stp.management.CcOncrpcServerMBean,node=testhost2Node02,
           process=server1
    
    wsadmin> set o [getOnc 1]  // 0 = "ClearQuest - 11", 1 = "ClearCase - 15"
            WebSphere:cell=testhost2Node02Cell,version=6.1.0.0,spec=1.0,name=ClearCase - 15,
            mbeanIdentifier=ClearCase - 15, type=stp.management.CcOncrpcServerMBean,
            node=testhost2Node02,process=server1
    
    wsadmin> $AdminControl getAttributes $o
           {serverType ClearCase}
           {serverState 1}
           {hostname testhost2}
           {port 4808}
           {serverId ClearCase - 15}
           {oncrpcCalls 2}
    
    // Here are examples of what you'll see when using the convenience dump commands:
    wsadmin> dumpAllServers
    
    ONCRPC Server: ClearCase - 0
    ============
    {serverType ClearCase}
    {serverState 1}
    {hostname testhost2}
    {port 3672}
    {serverId {ClearCase - 0
    {oncrpcCalls 7} 
    
    ONCRPC Server: ClearQuest - 0
    ============
    {workerThreadCount 10}
    {serverState 1}
    {activeStatefulHttpSessions 0} 
    {port 3693}
    {oncrpcCalls 1}
    {recycleServerHttpSessionLimit 500} 
    {serverStartTime 1215633895763}
    {serverId {ClearQuest - 0
    {recycleReasonCode 0}
    {serverType ClearQuest} 
    {hostname testhost2}
    {activeHttpSessions 0} 
    {totalHttpSessions 0}
    
    
    wsadmin> dumpCcServers
    CCRPC Server: ClearCase - 0
    ===========
    {serverType ClearCase}
    {serverState 1}
    {hostname duke2}
    {port 3672}
    {serverId {ClearCase - 0
    {oncrpcCalls 7} 
    
    
    
    wsadmin> dumpCqServers
    CQRPC Server: ClearQuest - 0
    ===========
    {workerThreadCount 10}
    {serverState 1}
    {activeStatefulHttpSessions 0} 
    {port 3693}
    {oncrpcCalls 1}
    {recycleServerHttpSessionLimit 500} 
    {serverStartTime 1215633895763}
    {serverId {ClearQuest - 0
    {recycleReasonCode 0}
    {serverType ClearQuest} 
    {hostname duke2}
    {activeHttpSessions 0} 
    {totalHttpSessions 0}
    
    
    wsadmin> dumpCqServerFactory
    CqServerFactoryMBean Attributes:
    ==========================
    {serverWorkerThreadCount 10}
    {recycleServerLifetimeLimit 14400}
    {recyclingPeriod 3600}
    {recycleServerOncrpcCallLimit 500000}
    {recycleServerHttpSessionLimit 500} 
    {maximumActiveServers 4}
    {activeHttpSessionThreshold 40}
    
    
    wsadmin> dumpCcServerFactory
    CcServerFactoryMBean Attributes:
    ==========================
    {oncrpcCallThreshold 5000}
    {idleServerInterval 600}
    {serverThresholdCount 50}
    {maxServersPerCredential 5}
    {maxServerCount 101}
    {interactionRequestTimeout 300}
    {busyServerPossiblyIdleLimit 14400}
    
    
    wsadmin> dumpAll
         // The output of this command is a dump of all of the MBean attribute values, including
         // all of the currently running backend ONCRPC server processes.
  • 用于导入和导出 MBean 属性的其他便捷命令

    除了使用 wsadmin 命令检索和设置各 MBean 属性外,还有两种方法可从属性文件导入 MBean 属性值或将 MBean 属性值导出到属性文件。可用文本编辑器编辑属性文件并且可以实时导入和导出属性文件;无需重新启动 CM Server。使用 wsadmin 时 CM Server 必须正在运行。

    您可以将属性文件中不需要的或不希望导入的所有条目注释掉。请确保遵循 MBean 名称和属性名称的命名约定(请参阅以下示例中导出的属性文件)。

    要使用 importFile 命令取消设置字符串值,请指定 "" 或在要导入的属性文件中将该值保留为空白。数字值不能为空白。

    // This wsadmin command loads all of the convenience commands and methods, including the importFile 
    // and exportToFile commands.  These commands enable easy retrieval and updating of MBean attribute values
    // as well as a simple way to capture specific configurations.  If the CM Server is experiencing difficulties, a
    // previously captured configuration can quickly be imported in real time. 
    wsadmin> source teamAdminUtils.jacl
    
    // Use the exportToFile convenience command if you want to capture a snapshot of the 
    // TeamServerMBean, CcServerFactoryMBean and the CqServerFactoryMBean MBeans.  Just specify 
    // the full pathname of where to store the file. The resulting properties file can then be edited using
    // a text editor, then imported using the importFile command.
    // NOTE: You must use forward-slashes in the pathname for each of these commands.
    wsadmin> exportToFile C:/temp/CmServer.properties
    
    File "C:/temp/CmServer.properties" does not exist, proceeding with export...
    Retrieving MBeans...
    Exporting TeamServerMBean.sessionReaperThreadDelay...
    Exporting TeamServerMBean.cqLoginSessionTimeout...
    Exporting TeamServerMBean.cqLoginSessionWaitTimeout...
    Exporting TeamServerMBean.sessionObjectDefaultTimeout...
    Exporting TeamServerMBean.sessionQueryObjectTimeout...
    Exporting TeamServerMBean.sessionRecordObjectTimeout...
    Exporting TeamServerMBean.oncrpcBufferLimit...
    Exporting TeamServerMBean.oncrpcInterruptLimit...
    Exporting TeamServerMBean.ejbBufferLimit...
    Exporting TeamServerMBean.ccrcLoginSessionTimeout...
    Exporting TeamServerMBean.ccrcViewStorage...
    Exporting TeamServerMBean.ccrcUploadLimit...
    Exporting TeamServerMBean.ccrcTempDir...
    Exporting TeamServerMBean.ccrcPrimaryGroup...
    Exporting TeamServerMBean.ccrcUnixCqHome...
    Exporting TeamServerMBean.ccrcVobLineTerminator...
    Exporting TeamServerMBean.ccrcUserRegionMapfile...
    Exporting TeamServerMBean.ccrcTraceLevel...
    Exporting TeamServerMBean.cqFulltextSearchPageSize...
    Exporting TeamServerMBean.cqFulltextSearchCacheSize...
    Exporting TeamServerMBean.cqFulltextSearchRecordHitLimit...
    Exporting TeamServerMBean.procureServerInterval...
    Exporting TeamServerMBean.maxProcureServerAttempts...
    Exporting TeamServerMBean.maxCqSessionsPerUser...
    Exporting CcServerFactoryMBean.maxServerCount...
    Exporting CcServerFactoryMBean.serverThresholdCount...
    Exporting CcServerFactoryMBean.idleServerInterval...
    Exporting CcServerFactoryMBean.maxServersPerCredential...
    Exporting CcServerFactoryMBean.interactionRequestTimeout...
    Exporting CcServerFactoryMBean.busyServerPossiblyIdleLimit...
    Exporting CcServerFactoryMBean.oncrpcCallThreshold...
    Exporting CqServerFactoryMBean.serverWorkerThreadCount...
    Exporting CqServerFactoryMBean.activeHttpSessionThreshold...
    Exporting CqServerFactoryMBean.maximumActiveServers...
    Exporting CqServerFactoryMBean.recycleServerHttpSessionLimit...
    Exporting CqServerFactoryMBean.recycleServerLifetimeLimit...
    Exporting CqServerFactoryMBean.recycleServerOncrpcCallLimit...
    Exporting CqServerFactoryMBean.recyclingPeriod...
    
    wsadmin> importFile C:/temp/CmServer.properties
    
    File "C:/temp/CmServer.properties" found, proceeding with import...
    Importing value '900' into property sessionReaperThreadDelay in MBean TeamServerMBean
        Old value=900
        New value=900
    Importing value '1803' into property cqLoginSessionTimeout in MBean TeamServerMBean
        Old value=1803
        New value=1803
    Importing value '120' into property cqLoginSessionWaitTimeout in MBean TeamServerMBean
        Old value=120
        New value=120
    Importing value '1800' into property sessionObjectDefaultTimeout in MBean TeamServerMBean
        Old value=1800
        New value=1800
       . . .
    
    // If you attempt to export to a file that already exists, a time-stamp is automatically 
    // appended to the filename you specified in the command:
    wsadmin> exportToFile C:/temp/CmServer.properties
    
    File "C:/temp/CmServer.properties" already exists; appending date to file name.
    exportFilePath is now: C:/temp/CmServer.properties_2008-07-09_16-27-11
    Retrieving MBeans...
    Exporting TeamServerMBean.sessionReaperThreadDelay...
    
    // Here is what a typical exported file looks like:
    C:\> type c:\temp\CmServer.properties
    # Export of CM Server MBean attributes, created: 2008-07-09_16-22-29
    #
    #
    # TeamServerMBean writable attributes
    #
    TeamServerMBean.sessionReaperThreadDelay=900
    TeamServerMBean.cqLoginSessionTimeout=1803
    TeamServerMBean.cqLoginSessionWaitTimeout=120
    TeamServerMBean.sessionObjectDefaultTimeout=1800
    TeamServerMBean.sessionQueryObjectTimeout=1803
    TeamServerMBean.sessionRecordObjectTimeout=10800
    TeamServerMBean.oncrpcBufferLimit=100
    TeamServerMBean.oncrpcInterruptLimit=1000
    TeamServerMBean.ejbBufferLimit=100
    TeamServerMBean.ccrcLoginSessionTimeout=900
    TeamServerMBean.ccrcViewStorage=
    TeamServerMBean.ccrcUploadLimit=0
    TeamServerMBean.ccrcTempDir=
    TeamServerMBean.ccrcPrimaryGroup=
    TeamServerMBean.ccrcUnixCqHome=
    TeamServerMBean.ccrcVobLineTerminator=
    TeamServerMBean.ccrcUserRegionMapfile=
    TeamServerMBean.ccrcTraceLevel=0
    TeamServerMBean.cqFulltextSearchPageSize=25
    TeamServerMBean.cqFulltextSearchCacheSize=1000
    TeamServerMBean.cqFulltextSearchRecordHitLimit=200
    TeamServerMBean.procureServerInterval=60
    TeamServerMBean.maxProcureServerAttempts=6
    TeamServerMBean.maxCqSessionsPerUser=2
    #
    # CcServerFactoryMBean writable attributes
    #
    CcServerFactoryMBean.maxServerCount=101
    CcServerFactoryMBean.serverThresholdCount=50
    CcServerFactoryMBean.idleServerInterval=600
    CcServerFactoryMBean.maxServersPerCredential=5
    CcServerFactoryMBean.interactionRequestTimeout=300
    CcServerFactoryMBean.busyServerPossiblyIdleLimit=14400
    CcServerFactoryMBean.oncrpcCallThreshold=5000
    #
    # CqServerFactoryMBean writable attributes
    #
    CqServerFactoryMBean.serverWorkerThreadCount=10
    CqServerFactoryMBean.activeHttpSessionThreshold=40
    CqServerFactoryMBean.maximumActiveServers=4
    CqServerFactoryMBean.recycleServerHttpSessionLimit=500
    CqServerFactoryMBean.recycleServerLifetimeLimit=14400
    CqServerFactoryMBean.recycleServerOncrpcCallLimit=500000
    CqServerFactoryMBean.recyclingPeriod=3600
相关概念
为 ClearQuest Web 修改 CM Server MBean 属性

反馈