集群环境中EJB计时器服务的自定义调度程序实例中的问题

时间:2018-12-06 08:43:00

标签: websphere websphere-8 was

  

我们将应用程序部署在Websphere应用程序服务器上。该应用程序在具有6个节点的集群环境中运行。 EJB计时器服务是使用自定义调度程序配置的,数据源指向Oracle数据库。因此,当应用程序部署在集群上时,它将触发Oracle数据库中提供的Node1上的Ejb计时器服务。

     

有时候oracle数据库中的值会自动更改为   其他节点,例如node2或node3,因为EJB计时器正在获取   已停止。有关其自动更改原因的任何建议或建议。

EJB计时器配置

Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).datasourceJNDIName = jdbc/cdb_db

Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).nonPersistentTimerRetryCount = -1 Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).nonPersistentTimerRetryInterval = 300 Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).numAlarmThreads = 1 Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).numNPTimerThreads = 1 Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).pollInterval = 300 Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).tablePrefix = EJBTIMER_ Server(0).components.ApplicationServer(1).components.EJBContainer(1).timerSettings.EJBTimer(0).uniqueTimerManagerForNP = false

1 个答案:

答案 0 :(得分:1)

正如在此问题上添加的第一条评论所指出的那样,让任何一个成员运行所有任务直到该成员不可用或无法足够迅速地响应是EJB Persistent Timers / Scheduler的设计行为。如果其他成员接管。

如果您不喜欢这种行为并希望对其进行更改,以使您的计时器任务只能在单个成员上运行,则可以通过在所有成员上停止调度程序轮询守护程序(您想要的成员除外)来实现此目的运行任务。这是一个知识中心文档,描述了如何执行此操作: https://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/scheduler/xmp/xsch_stopstart.html

请注意,如果您执行此操作,那么您将失去调度程序自动在其他成员上启动运行任务的能力,如果您指定运行该任务的成员失败了。在这种情况下,直到以下任何一个都不会运行任务 1)被允许运行它们的成员重新出现,或者 2)您手动使用上述WASScheduler MBean在其他成员上启动调度程序轮询守护程序,从而允许任务在该成员上运行

相关问题