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

    Finding JBoss leader

    jkwysdom

      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
          rhusar

          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=127.0.0.1:10190 "/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=127.0.0.1:10190 "/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