How to run one job per cluster?

ket.pjwstk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2012

Hi,

Last year we've deployed confluence for our customer and recently it turned out that some (custom - self devloped in our plugin) our jobs are executed per node. We want to make it execute once per cluster.

Any ideas?

2 answers

1 accepted

0 votes
Answer accepted
ket.pjwstk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2012

It looks like I have to answer my own Q. In atlassian plugin you have to add parameter (in job line) perClusterJob=true.

Thats all. Heres the magic wand.

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2012

Ah, a classical problem of distributed processing ....

You can either:

a) synchronize via DB (which is a shared resource anyway). For instance you create a running flag table and you run queries like:

update flagtable set f_running = 1 where f_running = 0;

Logic: if update count is 1, you can enter into processing. Finally, you must set the flag on zero, so "update flagtable set f_running = 0" will be necessary.

However, if current processing node fails completely, the flag will be set forever on 1, so the remaining nodes will be unable to progress. Manual or timeout recovery should be available.

Advantage: it's simple, most people understand it, you don't need to worry to much if it fails, it is usually acceptable to reset those counters after some time or manually.

b) Create a ring between the nodes of your cluster. Pass a token (message) from node to node; when the node receives the token, it can run.

Fun to implement, various algorithms exist. Disadvantage: Cost is high.

c) Use libraries that have already these implemented (check if quartz has it - I do not use quartz, so I'm not familiar with it, it's kinda "jobs for everyone" with a yellow page on top - link here).

d) Use libraries that creates shared memory over your nodes to shield you from low details. I do not know what's the status of JavaSpaces, it was intended to be for java what Linda/Glenda was for C.

Edit: let's not forget:

e) Create asymmetric installs. For instance, you set up a node with a configuration (JNDI string) "do.my.processing". In case of failure, you need to manually change that flag on some other node. Not very funny / smart.

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2012

I wish I had a magic wand .... it is a custom, self-developed plugin, right? Then, you need toprogram it correctly. Check if the quartz embedded into the product helps you (If I remember well, there's already there a quartz).

ket.pjwstk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2012

Well, I am aware that I can implement all this by myself. However I wonder if there is any out-of-box solution in confluence for this...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events