Quartz scheduler configuration in cluster
Quartz is a very popular open source scheduler engine. Quartz scheduler stores data related to scheduled jobs in the Liferay database.
In clustered environment there will be chance of starting the scheduler for all the nodes at same time which causes duplicate entries in the portal. We should execute only once for all the nodes.
Suppose if we have configured 4 nodes, then 4 scheduler will start at same time. But we need execute 1 scheduler for a job.
Hence in a clustered environment, it is possible that multiple nodes start the same job at the same time. This can create havoc. To prevent this situation, we need to configure Quartz for the clustered environment.
Add the following property in the portal-ext.properties
org.quartz.jobStore.isClustered=true
Drop all the tables starting with QUARTZ_. This step is required if Liferay tables are already created.
We just added a property to let the Quartz scheduler know that we are running multiple instances of the Quartz scheduler connected to a single database.
By enabling this property, the Quartz scheduler will make sure that each job is executed only once.
Kiến thức bạn share rất thông dụng, cảm ơn bạn đã share.
ReplyDeleteTìm hiểu Blog : Bán đá thạch anh
Bài viết của Bạn rất hữu ích, thank bạn đã share.
ReplyDeleteXem tại website : Đá thạch anh vụn rải bể cá
Bài viết của Admin rất hay, thank bạn đã share.
ReplyDeleteThông tin thêm : Tỳ hưu