[ 
https://issues.apache.org/jira/browse/NIFI-2304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15396867#comment-15396867
 ] 

ASF GitHub Bot commented on NIFI-2304:
--------------------------------------

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

    https://github.com/apache/nifi/pull/688#discussion_r72561569
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/ClusterProtocolHeartbeatMonitor.java
 ---
    @@ -91,12 +91,8 @@ public ClusterProtocolHeartbeatMonitor(final 
ClusterCoordinator clusterCoordinat
             this.clusterNodesPath = 
zkClientConfig.resolvePath("cluster/nodes");
     
             String hostname = 
properties.getProperty(NiFiProperties.CLUSTER_NODE_ADDRESS);
    -        if (hostname == null) {
    -            try {
    -                hostname = InetAddress.getLocalHost().getHostName();
    -            } catch (UnknownHostException e) {
    -                throw new RuntimeException("Unable to determine local 
hostname and the '" + NiFiProperties.CLUSTER_NODE_ADDRESS + "' property is not 
set");
    -            }
    +        if (hostname == null || hostname.trim().isEmpty()) {
    +            hostname = "localhost";
    --- End diff --
    
    Is there any specific reason to change from 
`InetAddress.getLocalHost().getHostName()` to `"localhost"`?
    
    I thought if server's hostname is properly configured at OS level, 
administrator doesn't have to set hostname in nifi.properties, which makes 
configuration management easier since they can use the same properties file 
among nodes.


> Cluster Coordinator reported incorrectly
> ----------------------------------------
>
>                 Key: NIFI-2304
>                 URL: https://issues.apache.org/jira/browse/NIFI-2304
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Bryan Bende
>            Assignee: Mark Payne
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> I created a two node cluster locally, running embedded ZK on node1.. both 
> nodes start up, but when trying to access the UI on the second node, it says 
> no coordinator exists. 
> Looking in the logs the coordinator is being reported as ":8889" where 8889 
> is the node protocol port. I left the node host blank assuming it would 
> default to localhost, but looks like it isn't. When I filled in the node host 
> everything worked as expected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to