Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

run cron job on multiple nodes (via scriptrunner)

eli.cohen March 22, 2021

Dear community

I need to set a cron job service that would send heartbeats to opsgenie to ensure that every node is healthy.

We have a Jira Data Center setup with multiple node.

Based on my analysis of scheduling groovy scripts via the scriptrunner jobs I see that the scriprunner service runs only one node per schedule. Is it possible to configure it e.q for all nodes or pin it to a specific one.

reading through the developer documentation of Atlassian I've found a way doing it with an custom plugin (https://developer.atlassian.com/server/jira/platform/developing-for-high-availability-and-clustering),but the effort would be far too great for this use case.

 

2 answers

0 votes
Rodolfo So October 27, 2022

@eli.cohen 

 

I would like to ask if you have scriptrunner script that can check the nodes status. Can you share with me.

 

Thanks

rahuldanwade
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.
March 8, 2023

Hi @Rodolfo So 

The following code snippet can give you node status and other details as well.

import com.atlassian.jira.cluster.ClusterManager

import com.atlassian.jira.component.ComponentAccessor



def componentAccessor = ComponentAccessor.newInstance()

def clusterManager = componentAccessor.getOSGiComponentInstanceOfType(ClusterManager.class)

Set clusterInfo = clusterManager.getAllNodes()

clusterInfo.each { it ->

    log. info it.getState().getI18nKey()

}

 

You can run this script as a job and send output to a file or send this information using email as well.

Thanks

Rahul

0 votes
Gonchik Tsymzhitov
Community Champion
July 3, 2021

Hi,

Looks better to check from outside healthy of nodes. Instead from platform 

Suggest an answer

Log in or Sign up to answer