1 Reply Latest reply on Mar 19, 2019 6:02 AM by Radoslav Husar

    Finding JBoss leader

    Josh Kirby Newbie

      First off I am completely new to JBoss and wildfly so please bear with me if I don't know what to post.


      That said onwards, I have a cluster of JBoss/widlfly and I need to figure out how to get the who is the leader using a bash/shell script. Mainly I just need to know if one exists, I don't even need any data about it though it would be a bonus to get some data about it.

        • 1. Re: Finding JBoss leader
          Radoslav Husar Master

          I suppose by leader you mean coordinator (a jgroups concept).


          One way is to use the jboss-cli in scripting, for instance run this script to find out whether the current node is the coordinator:


          [rhusar@ribera x]$ ./bin/jboss-cli.sh -c --controller= "/subsystem=jgroups/channel=ee/protocol=pbcast.GMS:read-attribute(name=coord)"


              "outcome" => "success",

              "result" => false


          to find out the coordinator from any node, you could use


          [rhusar@ribera x]$ ./bin/jboss-cli.sh -c --controller= "/subsystem=jgroups/channel=ee/protocol=pbcast.GMS:read-attribute(name=members)"


              "outcome" => "success",

              "result" => "(2) node3,node2"


          where the 1st node name is the coordinator.

          1 of 1 people found this helpful