How to identify the first JBoss EAP node in a cluster programmatically

Solution Verified - Updated -

Issue

  • We have a maintenance task that must be run when the first node in the cluster starts. What is the recommended way to implement this?
  • How can I identify the first node in a cluster ?
  • How do we query the container for the information such as whether a JBoss instance is the very first member of a cluster?   When the very first member of the cluster starts, we want our app to  run the special Initial_Startup logic one-and-only one time
  • We're looking for a way to run a singleton service only once (probably in the master) and then even if the master changes it must never be run unless there is a restart after all the servers have failed/stopped.

Environment

JBoss Enterprise Application Platform(EAP)

  • 4.x
  • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.