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 edited

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
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events