HBASE-24857:Fix several problems when starting webUI (#2245)

Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
GeorryHuang 2020-09-19 14:34:30 +08:00 committed by GitHub
parent 5e12c0aae5
commit 16831ec515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -258,7 +258,7 @@ if [ "${INTERNAL_CLASSPATH}" != "true" ]; then
# If command needs our shaded mapreduce, use it # 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 # 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 for c in "${commands_in_mr_jar[@]}"; do
if [ "${COMMAND}" = "${c}" ]; then if [ "${COMMAND}" = "${c}" ]; then
# If we didn't find a jar above, this will just be blank and the # If we didn't find a jar above, this will just be blank and the

View File

@ -140,7 +140,7 @@ public class CanaryTool implements Tool, Canary {
try { try {
InfoServer infoServer = new InfoServer("canary", addr, port, false, conf); InfoServer infoServer = new InfoServer("canary", addr, port, false, conf);
infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class); infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class);
infoServer.setAttribute("sink", this.sink); infoServer.setAttribute("sink", getSink(conf, RegionStdOutSink.class));
infoServer.start(); infoServer.start();
LOG.info("Bind Canary http info server to {}:{} ", addr, port); LOG.info("Bind Canary http info server to {}:{} ", addr, port);
} catch (BindException e) { } catch (BindException e) {
@ -979,8 +979,10 @@ public class CanaryTool implements Tool, Canary {
monitorTargets = new String[length]; monitorTargets = new String[length];
System.arraycopy(args, index, monitorTargets, 0, length); System.arraycopy(args, index, monitorTargets, 0, length);
} }
if (interval > 0) {
putUpWebUI(); //Only show the web page in daemon mode
putUpWebUI();
}
if (zookeeperMode) { if (zookeeperMode) {
return checkZooKeeper(); return checkZooKeeper();
} else if (regionServerMode) { } else if (regionServerMode) {