为系统维护配置通知和操作

传统:
IBM® Business Automation Workflow 系统可能会超负荷 (如果不调整系统并对随时间累积的工件类型 (例如流程实例,指定的 Snapshot ,未命名的 Snapshot ,任务实例和持久消息) 执行常规维护)。 如果不进行调优或定期维护,系统最终会出现性能下降,在极端情况下可能会出现系统停运。
为了防止出现此类问题,缺省情况下,当这些工件类型的实例数量超过允许的最大阈值时,系统会在 SystemOut.log 文件中记录警告消息。 如果系统处于“紧急”状态,那么将禁用 Snapshot 的安装,直至问题得到解决为止。 要提高或降低此可视性,您可以根据系统的当前调优、大小调整、使用情况和需求来定制通知和操作。

准备工作

在定制通知之前,尤其是在更改警告阈值和紧急阈值之前,请确保系统大小已调整并且系统已调优,以按预期的那样随增加的工件数执行。 建议在预生产环境中执行负载测试以验证当前大小调整和系统调优是否可应对增加的工件数或者定义所需的调优操作。 有关调整系统的多个区域的信息,请参阅 调整调整 IBM Business Automation Workflow

以下几个方面对于调优注意事项非常重要:

确保系统可应对更多的工件数之后,可以覆盖通知和操作设置的缺省值。 要执行此操作,可以使用 updateBPMConfig 命令在 100Custom.xml 文件中添加或修改设置。

关于本任务

您可以使用以下设置来控制想要监控的工件类型、何时记录消息以及当数据量超过阈值时要执行的操作。 缺省情况下,已启用这些设置。 要将其禁用,请将 enabled 设置为 false

system-maintenance-monitor
如果想要启用监视器,请确保此值为 true
log-on-server-start
如果想要监视器在服务器启动时向 SystemOut.log 文件发送状态,请确保此值为 true
log-interval
设置监视器记录信息的频率。 以分钟为单位指定此值。 缺省值为 1440 分钟(24 小时)。
监视/监视器 (monitor)
指定想要监控的工件类型及其属性:
  • type:要监控的工件类型
  • servertype(可选):对于已命名的 Snapshot 和未命名的 Snapshot,请指定要监控工件类型的服务器位置。 对于 Workflow Server,请将该值设置为 PS。 对于 Workflow Center,请将该值设置为 PC。 要同时指定这两个位置,请确保该值设置为 ALL(缺省值)。
预定义监视器包括 NAMED_SNAPSHOTSUNNAMED_SNAPSHOTSPROCESS_INSTANCESTASK_INSTANCESDURABLE_MESSAGES
critical-threshold
指定在系统进入紧急状态并需要立即进行维护之前,指定允许累积的工件类型的实例的最大数量。 当实例数量超过紧急阈值时,监视器会按指定时间间隔通过 SystemOut.log 文件消息向您发出通知。 缺省情况下,在指定的 Snapshot 的数量超过紧急阈值时,也将禁用 Snapshot 安装。 预定义属性的缺省紧急阈值如下所示:
  • Workflow Server 上的 NAMED_SNAPSHOTS:128
  • Workflow Center 上的 NAMED_SNAPSHOTS:500
  • UNNAMED_SNAPSHOTS:10000
  • PROCESS_INSTANCES:600000
  • TASK_INSTANCES:2400000
  • DURABLE_MESSAGES:8000000
warning-threshold
指定在需要考虑执行系统维护之前允许累积的工件类型实例的数量。 当实例数量超过警告阈值时,监视器会按指定时间间隔通过 SystemOut.log 文件消息向您发出通知。 预定义属性的缺省警告阈值如下所示:
  • Workflow Server 上的 NAMED_SNAPSHOTS:100
  • Workflow Center 上的 NAMED_SNAPSHOTS:400
  • UNNAMED_SNAPSHOTS:5000
  • PROCESS_INSTANCES:400000
  • TASK_INSTANCES:1600000
  • DURABLE_MESSAGES:5000000
prevent-lifecycle-action
要在工件类型的实例数量超过紧急阈值时禁用 Snapshot 的安装或导入,请在 100Custom.xml 文件中添加此元素,并指定 INSTALL 作为值。 INSTALL 是此元素的唯一有效值。

在 Workflow Server 上,指定 INSTALL 值将禁用 Snapshot 安装。 INSTALLNAMED_SNAPSHOTS监控, 要启用安装,请替换 100Custom.xml 文件中的监视器元素,并省略此设置。

在 Workflow Center 上,指定 INSTALL 值会禁用 Snapshot 的导入。
show-message-on-lifecycle-action
工件类型的实例数超过警告阈值时,每次在 Workflow Server 上安装或者在 Workflow Center 上导入 Snapshot 时,监视器都显示一条警告。 INSTALL 是缺省值,也是唯一有效值。 要禁用消息,请替换 100Custom.xml 文件中的监视器元素,并省略此设置。
如果要更改这些设置的值,可以通过在 100Custom.xml 文件中添加或更新这些设置来覆盖这些值。 例如,要将设置添加到 100Custom.xml 文件,您可以在 <properties> 元素下添加以下元素,并根据需要修改该值:
<server>
   <system-maintenance-monitor merge="replace" enabled="true">
     <log-on-server-start merge="replace">true</log-on-server-start> 
     <log-interval merge="replace">1400</log-interval>

     <monitor type="NAMED_SNAPSHOTS" merge="replace" enabled="true" servertype="PS">
          <critical-threshold>128</critical-threshold>
          <warning-threshold>100</warning-threshold>
          <prevent-lifecycle-action>INSTALL</prevent-lifecycle-action>
     </monitor>

     <monitor type="NAMED_SNAPSHOTS" merge="replace" enabled="true" servertype="PC">
          <critical-threshold>500</critical-threshold>
          <warning-threshold>400</warning-threshold>
          <prevent-lifecycle-action>INSTALL</prevent-lifecycle-action>
     </monitor>     

     <monitor type="UNNAMED_SNAPSHOTS" merge="replace" enabled="true" servertype="PC">
          <critical-threshold>10000</critical-threshold>
          <warning-threshold>5000</warning-threshold>
         <show-message-on-lifecycle-action>INSTALL</show-message-on-lifecycle-action>
     </monitor>

     <monitor type="PROCESS_INSTANCES" merge="replace" enabled="true">
          <critical-threshold>600000</critical-threshold>
          <warning-threshold>400000</warning-threshold>
          <show-message-on-lifecycle-action>INSTALL</show-message-on-lifecycle-action>     
     </monitor>

     <monitor type="TASK_INSTANCES" merge="replace" enabled="true">
          <critical-threshold>2400000</critical-threshold>
          <warning-threshold>1600000</warning-threshold>
           <show-message-on-lifecycle-action>INSTALL</show-message-on-lifecycle-action>
     </monitor>

      <monitor type="DURABLE_MESSAGES" merge="replace" enabled="true">
          <critical-threshold>8000000</critical-threshold>
          <warning-threshold>5000000</warning-threshold>
          <show-message-on-lifecycle-action>INSTALL</show-message-on-lifecycle-action>
      </monitor>
   </system-maintenance-monitor>
</server>
注: 如果没有为特定监视器定义任何操作,那么不会执行任何操作。 在特定监控下必须存在 <prevent-lifecycle-action><show-message-on-lifecycle-action>

如果未定义阈值,那么不会执行任何操作,因为它使用阈值来启动其操作。 必须定义 <critical-threshold>和/或 <warning-threshold>设置才能使相应的操作起作用。

有关更改 100Custom.xml 文件的信息,请参阅 100Custom.xml 文件和配置。 有关必须更新的各个 100Custom.xml 文件及其位置的信息,请参阅 100Custom 配置文件的位置

但是,要一致且可靠地更改 Business Automation Workflow 部署环境中所有 100Custom.xml 文件中这两个设置的值,建议您使用 updateBPMConfig 命令,如以下过程中所述:

过程

  1. 停止 Workflow ServerWorkflow Center的服务器。
  2. 以断开连接方式启动脚本编制客户机,如主题 updateBPMConfig 命令中所述。
  3. 对于每个属性,请运行以下命令以同时更新所有受影响的服务器:
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/@merge', '-xNodeValue', 'replace' ] )  
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/@enabled', '-xNodeValue', 'true_or_false' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/log-on-server-start', '-xNodeValue', 'true_or_false' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/log-interval', '-xNodeValue', 'interval_value' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/@merge', '-xNodeValue', 'replace' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/@type', '-xNodeValue', 'artifact_type' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/@enabled', '-xNodeValue', 'true_or_false' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/@servertype', '-xNodeValue', 'server_type' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/critical-threshold', '-xNodeValue', 'critical_threshold_value' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/warning-threshold', '-xNodeValue', 'warning_threshold_value' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/prevent-lifecycle-action', '-xNodeValue', 'application_action' ] )
    wsadmin> AdminTask.updateBPMConfig( [ '-create', '/server/system-maintenance-monitor/monitor/show-message-on-lifecycle-action', '-xNodeValue', 'application_action' ] )
    wsadmin> AdminConfig.save()
    true_or_false 变量替换为 truefalse,并将其他变量(如 interval_valueartifact_typeserver_typecritical_threshold_valuewarning_threshold_valueapplication_action)替换为相应的值。
    注: 先前的命令假定尚未在 100Custom.xml 文件中定义属性。 如果它们已可用,请为这些 updateBPMConfig 命令选择选项 -update 而不是 -create
  4. 重新启动服务器。

结果

更新 100Custom.xml 文件的建议方式是运行 updateBPMConfig 命令。 但是,如果更新失败,您可以通过执行主题 创建 100Custom.xml 配置文件中的步骤来手动更新文件。