You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/09/10 04:47:21 UTC

[hbase] branch branch-2.3 updated: HBASE-24857:Fix several problems when starting webUI (#2344)

This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new 7ba24d7  HBASE-24857:Fix several problems when starting webUI (#2344)
7ba24d7 is described below

commit 7ba24d75ca2483c5b66c7684b76c4d6ef3489088
Author: GeorryHuang <21...@qq.com>
AuthorDate: Thu Sep 10 12:46:32 2020 +0800

    HBASE-24857:Fix several problems when starting webUI (#2344)
---
 bin/hbase                                                         | 2 +-
 .../src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java    | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/hbase b/bin/hbase
index 5e2778c..d33749b 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -256,7 +256,7 @@ if [ "${INTERNAL_CLASSPATH}" != "true" ]; then
 
   # If command needs our shaded mapreduce, use it
   # N.B "mapredcp" is not included here because in the shaded case it skips our built classpath
-  declare -a commands_in_mr_jar=("hbck" "snapshot" "canary" "regionsplitter" "pre-upgrade")
+  declare -a commands_in_mr_jar=("hbck" "snapshot" "regionsplitter" "pre-upgrade")
   for c in "${commands_in_mr_jar[@]}"; do
     if [ "${COMMAND}" = "${c}" ]; then
       # If we didn't find a jar above, this will just be blank and the
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
index 9ed2b91..64a2d51 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
@@ -140,7 +140,7 @@ public class CanaryTool implements Tool, Canary {
       try {
         InfoServer infoServer = new InfoServer("canary", addr, port, false, conf);
         infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class);
-        infoServer.setAttribute("sink", this.sink);
+        infoServer.setAttribute("sink", getSink(conf, RegionStdOutSink.class));
         infoServer.start();
         LOG.info("Bind Canary http info server to {}:{} ", addr, port);
       } catch (BindException e) {
@@ -979,8 +979,10 @@ public class CanaryTool implements Tool, Canary {
       monitorTargets = new String[length];
       System.arraycopy(args, index, monitorTargets, 0, length);
     }
-
-    putUpWebUI();
+    if (interval > 0) {
+      //Only show the web page in daemon mode
+      putUpWebUI();
+    }
     if (zookeeperMode) {
       return checkZooKeeper();
     } else if (regionServerMode) {