GeorryHuang commented on a change in pull request #1292: HBASE-23994:Add WebUI
to Canary
URL: https://github.com/apache/hbase/pull/1292#discussion_r406766094
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
##########
@@ -122,6 +125,35 @@
*/
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS)
public class CanaryTool implements Tool, Canary {
+ public static final String HBASE_CANARY_INFO_PORT = "hbase.canary.info.port";
+
+ public static final int DEFAULT_CANARY_INFOPORT = 16050;
+
+ public static final String HBASE_CANARY_INFO_BINDADDRESS =
"hbase.canary.info.bindAddress";
+
+
+ private void putUpWebUI() throws IOException {
+ if (zookeeperMode) {
+ LOG.info("WebUI is not supported in Zookeeper mode");
+ } else if (regionServerMode) {
+ LOG.info("WebUI is not supported in RegionServer mode");
+ } else {
+ Configuration conf = new Configuration();
+ int port = conf.getInt(HBASE_CANARY_INFO_PORT, DEFAULT_CANARY_INFOPORT);
+ // -1 is for disabling info server
+ if (port < 0) return;
+ String addr = conf.get(HBASE_CANARY_INFO_BINDADDRESS, "0.0.0.0");
+ try {
+ InfoServer infoServer = new InfoServer("canary", addr, port, false,
conf);
+ infoServer.addUnprivilegedServlet("canary", "/canary-status",
CanaryStatusServlet.class);
+ infoServer.setAttribute("sink", this.sink);
+ infoServer.start();
+ LOG.info("Bind Canary http info server to port: " + port);
Review comment:
> Might as well print out the full socket address (bind address:port)
Good iead!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services