ivandika3 commented on code in PR #10598:
URL: https://github.com/apache/ozone/pull/10598#discussion_r3670514879
##########
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:
> I did some more investigation into this.
Thanks for the investigation and raising the ticket.
> 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.
I think you're right. Let's keep the workaround for now and we can probably
remove it if we don't use the `CachedDNSToSwitchMapping` anymore.
--
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]