0 Replies Latest reply on Nov 5, 2013 9:56 AM by jarirajari

    CLI commands for starting, stopping, and querying Wildfly in domain mode

    jarirajari Newbie

      Hello Everyone! I would like to help others and myself by gathering and summarizing the available information on starting and stopping Wildfly in domain mode. For this reason, I am asking for your help: we need to figure out the "correct" commands for the use cases that follow. First, I'll define the scope and finally I'll present my questions. IMHO, at the moment, this information is pretty much scattered and/or inconsistent. I will collect the results and produce a summary. Thanks.

       

      The example domain (6 servers in 3 hosts):

       

      Hosts: H1, H2, H3

      Server-groups: G1, G2

      Servers: H1G1S1, H2G1S2, H3G1S3, H1G2S4, H2G2S5, H3G2S6

       

      SRVRS | GROUP 1      | GROUP2      |

      =============================

      HOST 1 | H1G1S1 (S1) | H1G2S4 (S4) |

      HOST 2 | H2G1S2 (S2) | H2G2S5 (S5) |

      HOST 3 | H3G1S3 (S3) | H3G2S6 (S6) |

       

      Definitions:

       

      The targets (domain mode):

      • HOST
      • SERVER-GROUP
      • SERVER

       

      The target commands:

      • START (start the target)
      • RUN (basically means checking if the target is running)
      • STOP (stop the target)

       

      The command execution:

      • Command to be run (START, RUN, STOP) on a target (HOST, SERVER-GROUP, or SERVER)
      • Result of the command execution (SUCCESS, FAILURE) and actual result (see question b)

       

      Different states of a target:

      1. Stopped  (initial state)
      2. Starting (after START)
      3. Started  (after START success)
      4. Running  (automatically after 'Started')
      5. Stopping (after STOP)
      6. Stopped  (after STOP success, initial state)

       

      Questions:

       

      Answers should make use of CLI and/or CLI scripting.

       

      a) How to issue each target command on each target?

      1. HOST, how to execute START, RUN, STOP?
      2. SERVER-GROUP, how to execute START, RUN, STOP?
      3. SERVER, how to execute START, RUN, STOP?

       

      b) How to query state of HOST, SERVER-GROUP, and SERVER (so same set of queries for each)? Also, please comment  if a particular query is not feasible or reasonable for that target. The return type can be Boolean, or JSON, for instance...

      1. [Boolean/JSON/etc] target.isStopped()
      2. [Boolean/JSON/etc] target.isStarting()
      3. [Boolean/JSON/etc] target.isStarted()
      4. [Boolean/JSON/etc] target.isRunning()
      5. [Boolean/JSON/etc] target.isStopping()
      6. (same as first)
      7. [Boolean/JSON/etc] target.isHealthy() (bonus query for basic health checking, like memory, cpu, etc.)