如果部署有2个副本,Quarkus中的调度器会执行2次吗?

huangapple go评论63阅读模式
英文:

If the deployment has 2 replicas, will the scheduler in quarkus be executed 2 times?

问题

我是中文翻译,以下是翻译好的部分:

am new to kubernetes. i have question about kubernetes.
i have quarkus deployment and have scheduling periodic tasks.
is there any chance that the scheduler will run as many replicas?

@Scheduled(cron="3 0 2 * * ?")
英文:

am new to kubernetes. i have question about kubernetes.
i have quarkus deployment and have scheduling periodic tasks.
is there any chance that the scheduler will run as many replicas?

    @Scheduled(cron="3 0 2 * * ?") 

答案1

得分: 1

是的。

除非您在应用程序之间实现某种类型的集群,否则复制品是独立的进程,将执行相同的操作。

英文:

Yes.

Unless you implement some kind of clustering in between your applications, replicas are standalone processes that would execute just the same.

答案2

得分: 0

如果您想要为每个集群安排单个任务执行,您将需要使用集群化的Quartz设置:https://quarkus.io/guides/quartz

英文:

Yes, if you want to schedule a single task execution per cluster you will need to use a clustered quartz setup: https://quarkus.io/guides/quartz

huangapple
  • 本文由 发表于 2023年2月10日 05:45:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75404732.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定