一、报错详情
2023-05-05 16:45:22.922 [QuartzScheduler_xxScheduler-xxx_ClusterManager] WARN o.s.scheduling.quartz.LocalDataSourceJobStore:3411 - This scheduler instance (xxx) is still active but was recovered by another instance in the cluster. This may cause inconsistent behavior.
控制台log重复输出以上内容,不执行定时器。
二、报错原因
可能在不同的服务器(集群)下,搭载了一套相同的应用(有可能是不同的应用环境:prod、test等等)已经在执行该定时任务,Quartz为保证数据一致性,后启动的定时任务不会执行。
三、 解决方案
关掉另外一个地方的定时任务,重启当前应用。
学习参考:Spring Quartz提示:This scheduler instance is still active but was recovered by another in the cluster…