Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-25237

'hbase master stop' shuts down the cluster, not the master only

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 1.7.0, 2.4.0, 2.2.7, 2.3.4
    • None
    • None
    • Reviewed
    • Hide
      `hbase master stop` should shutdown only master by default.
      1. Help added to `hbase master stop`:
      To stop cluster, use `stop-hbase.sh` or `hbase master stop --shutDownCluster`

      2. Help added to `stop-hbase.sh`:
      stop-hbase.sh can only be used for shutting down entire cluster. To shut down (HMaster|HRegionServer) use hbase-daemon.sh stop (master|regionserver)
      Show
      `hbase master stop` should shutdown only master by default. 1. Help added to `hbase master stop`: To stop cluster, use `stop-hbase.sh` or `hbase master stop --shutDownCluster` 2. Help added to `stop-hbase.sh`: stop-hbase.sh can only be used for shutting down entire cluster. To shut down (HMaster|HRegionServer) use hbase-daemon.sh stop (master|regionserver)

    Description

      This is confusing (an operator at place-of-employment shut down a massive cluster mistakenly thinking he was shutting down the master only).

      If I run 'hbase master --help', it says unsupported and then dumps out:

      org.apache.hbase.thirdparty.org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --help
       at org.apache.hbase.thirdparty.org.apache.commons.cli.Parser.processOption(Parser.java:383)
       at org.apache.hbase.thirdparty.org.apache.commons.cli.Parser.parse(Parser.java:210)
       at org.apache.hbase.thirdparty.org.apache.commons.cli.Parser.parse(Parser.java:88)
       at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:89)
       at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
       at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
       at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2945)
      Usage: Master [opts] start|stop|clear
       start Start Master. If local mode, start Master and RegionServer in same JVM
       stop Start cluster shutdown; Master signals RegionServer shutdown
       clear Delete the master znode in ZooKeeper after a master crashes
       where [opts] are:
       --minRegionServers=<servers> Minimum RegionServers needed to host user tables.
       --localRegionServers=<servers> RegionServers to start in master process when in standalone mode.
       --masters=<servers> Masters to start in this process.
       --backup Master should start in backup mode

       

      ... so the 'help' is clear that its the cluster that goes down, not just the master – but that is hardly compensates for the unexpected behavior.

       

      'hbase master stop' is actually what is used internally you run stop-hbase.sh.

       

      Stopping the cluster when your run 'hbase master stop' is actually very old behavior. Its still confusing though. We could change this.

      If I run 'hbase regionserver stop', it does this:

      System.err.println(
        "To shutdown the regionserver run " +
        "hbase-daemon.sh stop regionserver or send a kill signal to " +
        "the regionserver pid");

      I'd think we could make improvement here. We could do something like the RS output if user types 'hbase master stop' at a minimum requiring operator add a '–force' flag if they want the cluster to go down or point them to a new hbase cluster stop/hbase cluster start or point them at stop-hbase.sh.  Should also change mode so 'hbase master stop' stops the master and not the cluster (there was no stopMaster when the 'hbase master stop' was added originally – but there is one now).

       

      Attachments

        1. HBASE-25237.patch
          3 kB
          Lokesh Khurana

        Activity

          People

            lokiore Lokesh Khurana
            stack Michael Stack
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: