Github user milleruntime commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/221#discussion_r103011409
  
    --- Diff: 
server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java ---
    @@ -496,20 +497,27 @@ public void run(String hostname) {
           throw new RuntimeException(e);
         }
     
    -    try {
    -      log.debug("Using " + hostname + " to advertise monitor location in 
ZooKeeper");
    -
    -      String monitorAddress = HostAndPort.fromParts(hostname, 
server.getPort()).toString();
    +    String advertiseHost = hostname;
    +    if (advertiseHost.equals("0.0.0.0")) {
    +      try {
    +        advertiseHost = InetAddress.getLocalHost().getHostName();
    +      } catch (UnknownHostException e) {
    +        log.error("Unable to get hostname", e);
    +      }
    +    }
    +    log.debug("Using " + advertiseHost + " to advertise monitor location");
     
    +    try {
    +      String monitorAddress = HostAndPort.fromParts(advertiseHost, 
server.getPort()).toString();
           
ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + 
Constants.ZMONITOR_HTTP_ADDR, monitorAddress.getBytes(UTF_8),
               NodeExistsPolicy.OVERWRITE);
           log.info("Set monitor address in zookeeper to " + monitorAddress);
         } catch (Exception ex) {
           log.error("Unable to set monitor HTTP address in zookeeper", ex);
         }
     
    -    if (null != hostname) {
    -      LogService.startLogListener(Monitor.getContext().getConfiguration(), 
instance.getInstanceID(), hostname);
    +    if (null != advertiseHost) {
    +      LogService.startLogListener(Monitor.getContext().getConfiguration(), 
instance.getInstanceID(), advertiseHost);
    --- End diff --
    
    Wouldn't hurt to sync up with Luis on changes to the Monitor


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to