hevinhsu commented on code in PR #10598:
URL: https://github.com/apache/ozone/pull/10598#discussion_r3663227781


##########
hadoop-ozone/mini-cluster/src/main/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java:
##########
@@ -698,14 +771,32 @@ protected List<HddsDatanodeService> createHddsDatanodes()
 
       for (int i = 0; i < numOfDatanodes; i++) {
         OzoneConfiguration dnConf = dnFactory.apply(conf);
+        if (hosts != null) {
+          dnConf.set(HddsConfigKeys.HDDS_DATANODE_HOST_NAME_KEY, hosts[i]);
+        }
 
+        // Bypass InetAddress.getName() resolution for custom hostnames by 
starting DN via YAML.
+        confDatanodeViaYaml(dnConf);

Review Comment:
   > To avoid this workaround, how about we just set `setHostname` to 127.0.0.1 
or `DNS.getDefaultHost`? Will it work?
   
   Thanks for the suggestion! I think it should work for avoiding this 
workaround.
   
   I'm wondering if it would affect the rack mapping, since it is based on the 
hostname. If all Datanodes use 127.0.0.1 or `DNS.getDefaultHost()`, they would 
all share the same hostname and could no longer be mapped to different racks. 
It would also mean that the values provided via `setHosts()` are no longer 
reflected in the registered DatanodeDetails.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to