Skip to content

Commit 9b02a26

Browse files
committed
HBASE-24698 Turn OFF Canary WebUI as default (#2037)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
1 parent 4b3ef81 commit 9b02a26

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/**
2-
*
1+
/*
32
* Licensed to the Apache Software Foundation (ASF) under one
43
* or more contributor license agreements. See the NOTICE file
54
* distributed with this work for additional information
@@ -21,7 +20,6 @@
2120

2221
import static org.apache.hadoop.hbase.HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT;
2322
import static org.apache.hadoop.hbase.HConstants.ZOOKEEPER_ZNODE_PARENT;
24-
2523
import java.io.Closeable;
2624
import java.io.IOException;
2725
import java.net.BindException;
@@ -50,7 +48,6 @@
5048
import java.util.concurrent.atomic.LongAdder;
5149
import java.util.regex.Matcher;
5250
import java.util.regex.Pattern;
53-
5451
import org.apache.commons.lang3.time.StopWatch;
5552
import org.apache.hadoop.conf.Configuration;
5653
import org.apache.hadoop.hbase.AuthUtil;
@@ -102,7 +99,6 @@
10299
import org.apache.zookeeper.data.Stat;
103100
import org.slf4j.Logger;
104101
import org.slf4j.LoggerFactory;
105-
106102
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
107103
import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
108104

@@ -127,15 +123,10 @@
127123
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS)
128124
public class CanaryTool implements Tool, Canary {
129125
public static final String HBASE_CANARY_INFO_PORT = "hbase.canary.info.port";
130-
131-
public static final int DEFAULT_CANARY_INFOPORT = 16050;
132-
133126
public static final String HBASE_CANARY_INFO_BINDADDRESS = "hbase.canary.info.bindAddress";
134127

135-
private InfoServer infoServer;
136-
137128
private void putUpWebUI() throws IOException {
138-
int port = conf.getInt(HBASE_CANARY_INFO_PORT, DEFAULT_CANARY_INFOPORT);
129+
int port = conf.getInt(HBASE_CANARY_INFO_PORT, -1);
139130
// -1 is for disabling info server
140131
if (port < 0) {
141132
return;
@@ -147,7 +138,7 @@ private void putUpWebUI() throws IOException {
147138
} else {
148139
String addr = conf.get(HBASE_CANARY_INFO_BINDADDRESS, "0.0.0.0");
149140
try {
150-
infoServer = new InfoServer("canary", addr, port, false, conf);
141+
InfoServer infoServer = new InfoServer("canary", addr, port, false, conf);
151142
infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class);
152143
infoServer.setAttribute("sink", this.sink);
153144
infoServer.start();
@@ -1114,6 +1105,8 @@ private void printUsageAndExit() {
11141105
System.err.println(" -D<configProperty>=<value> to assign or override configuration params");
11151106
System.err.println(" -Dhbase.canary.read.raw.enabled=<true/false> Set to enable/disable " +
11161107
"raw scan; default=false");
1108+
System.err.println(" -Dhbase.canary.info.port=PORT_NUMBER Set for a Canary UI; " +
1109+
"default=-1 (None)");
11171110
System.err.println("");
11181111
System.err.println("Canary runs in one of three modes: region (default), regionserver, or " +
11191112
"zookeeper.");

0 commit comments

Comments
 (0)