监视 Java EE 组件

监视应用服务器和协作(命令行)

可使用 Enterprise Manager 命令行客户端的运行时服务来监视应用服务器和协作。

在开始之前,请确保 Enterprise Manager 服务器正在运行。

-s 参数设置为 RuntimeService51x。将 -m 参数设置为所需的方法。对于每个参数,请将 -P 参数设置为名称和值。


注 –

将在多行中显示这些命令以提高可读性。您必须在一行中输入这些命令。


列出运行时服务的可用方法

可以使用 -n 参数来显示运行时服务的可用方法列表。例如:


em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC
-s RuntimeService51x -n

 Note: the order of the parameters is important.
 Available methods and parameters:

-m getState -Pcomponent=<component> -PcomponentType=<componentType>
-m startComponent -Pcomponent=<component> -PcomponentType=<componentType>
-m getComponentsList
-m stopComponent -Pcomponent=<component> -PcomponentType=<componentType>
-m getStatus -Pcomponent=<component> -PcomponentType=<componentType>

显示组件列表

运行时服务的方法要求您指定组件路径和组件类型。使用 getComponentsList 方法,您可以获取此信息。例如:


em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC
-s RuntimeService51x
-m getComponentsList

e51x|Servers|myserver:4848
is51x

e51x|Servers|myserver:4848|IQ_Manager_18007
stcms

e51x|Servers|myserver:4848|Sun_JMQ_7676
jmq

e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service1
jce.JavaCollaborationDefinition

e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service2
jce.JavaCollaborationDefinition

e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Topic1
messageService.Topic

显示当前状态

使用 getState 方法,可以显示应用服务器或协作以及 JMS IQ Manager 的当前状态。您必须指定以下参数:组件路径和组件类型。例如:


em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC
-s RuntimeService51x
-m getState
-Pcomponent="e51x|Servers|myserver:4848"
-PcomponentType=is51x

Up

查看基本信息

使用 getStatus 方法,可以查看应用服务器或协作的基本信息。您必须指定以下参数:组件路径和组件类型。例如:


em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC
-s RuntimeService51x
-m getStatus
-Pcomponent="e51x|Servers|myserver:4848"
-PcomponentType=is51x

HostAndPort = myserver:4848
Component = e51x|Servers|myserver:4848
System = e51x
RestartRequired = true

启动和停止协作

使用 startComponent 方法,可以启动协作。您必须指定以下参数:组件路径和组件类型。例如:


em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC
-s RuntimeService51x
-m startComponent
-Pcomponent="e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service1"
-PcomponentType=jce.JavaCollaborationDefinition

使用 stopComponent 方法,可以停止应用服务器域、应用服务器实例或协作。您必须指定以下参数:组件路径和组件类型。例如:


em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC
-s RuntimeService51x
-m stopComponent
-Pcomponent="e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service1"
-PcomponentType=jce.JavaCollaborationDefinition

注 –

无法使用 stopComponent 方法来停止消息服务器。


命令行并不提供指示方法是否成功的反馈。不过,您可以使用 getState 方法来验证组件是处于启动还是关闭状态。