使用quartz+spring进行的开发。部署成集群之后发现日志频繁刷warn。使用mysql。
麻烦大神给看看,不知道是我哪里配置有错误,还是说忽略这些告警就可以。报错日志如下:
info级别和warn级别的这两句日志一直在刷,几十秒一次。[WARN][2018-03-15 14:00:48,863][testServer][QuartzScheduler_quartzScheduler-JTZH-ORACLE1521093564936_ClusterManager][org.springframework.scheduling.quartz.LocalDataSourceJobStore][3334]This scheduler instance (JTZH-ORACLE1521093564936) is still active but was recovered by another instance in the cluster. This may cause inconsistent behavior.
[INFO][2018-03-15 17:15:33,091][testServer][QuartzScheduler_quartzScheduler-localhost.localdomain1521104489623_ClusterManager][org.springframework.scheduling.quartz.LocalDataSourceJobStore][3426]ClusterManager: Scanning for instance "JTZH-ORACLE1521097875201"'s failed in-progress jobs.
quartz.properties配置如下:org.quartz.scheduler.instanceName = TestScheduler1
org.quartz.scheduler.instanceId = AUTOorg.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = trueorg.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.maxMisfiresToHandleAtATime=10
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
spring配置如下:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="applicationContextSchedulerContextKey" value="applicationContextKey"/>
<property name="configLocation" value="classpath:quartz.properties"/>
<property name="triggers">
<list>
<ref bean="triggerUpsmsTimeout"/>
<ref bean="triggerAdeDownJob"/>
</list>
</property>
<property name="overwriteExistingJobs" value="true" />
</bean>
<bean id="jobDetailUpsmsTimeout" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass">
<value>com.test.quartz.job.UpsmsTimeout</value>
</property>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="true"/>
</bean>
<bean id="triggerUpsmsTimeout" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobDetailUpsmsTimeout"/>
<property name="cronExpression" value="1 */10 * ? * * *"/>
</bean>
</beans>
麻烦大神给看看,不知道是我哪里配置有错误,还是说忽略这些告警就可以。报错日志如下:
info级别和warn级别的这两句日志一直在刷,几十秒一次。[WARN][2018-03-15 14:00:48,863][testServer][QuartzScheduler_quartzScheduler-JTZH-ORACLE1521093564936_ClusterManager][org.springframework.scheduling.quartz.LocalDataSourceJobStore][3334]This scheduler instance (JTZH-ORACLE1521093564936) is still active but was recovered by another instance in the cluster. This may cause inconsistent behavior.
[INFO][2018-03-15 17:15:33,091][testServer][QuartzScheduler_quartzScheduler-localhost.localdomain1521104489623_ClusterManager][org.springframework.scheduling.quartz.LocalDataSourceJobStore][3426]ClusterManager: Scanning for instance "JTZH-ORACLE1521097875201"'s failed in-progress jobs.
quartz.properties配置如下:org.quartz.scheduler.instanceName = TestScheduler1
org.quartz.scheduler.instanceId = AUTOorg.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = trueorg.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.maxMisfiresToHandleAtATime=10
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
spring配置如下:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="applicationContextSchedulerContextKey" value="applicationContextKey"/>
<property name="configLocation" value="classpath:quartz.properties"/>
<property name="triggers">
<list>
<ref bean="triggerUpsmsTimeout"/>
<ref bean="triggerAdeDownJob"/>
</list>
</property>
<property name="overwriteExistingJobs" value="true" />
</bean>
<bean id="jobDetailUpsmsTimeout" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass">
<value>com.test.quartz.job.UpsmsTimeout</value>
</property>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="true"/>
</bean>
<bean id="triggerUpsmsTimeout" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobDetailUpsmsTimeout"/>
<property name="cronExpression" value="1 */10 * ? * * *"/>
</bean>
</beans>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货