[
https://issues.apache.org/jira/browse/DRILL-4935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15649094#comment-15649094
]
ASF GitHub Bot commented on DRILL-4935:
---------------------------------------
Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/647#discussion_r87103376
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/service/ServiceEngine.java
---
@@ -140,9 +140,19 @@ private static BufferAllocator newAllocator(
name, context.getConfig().getLong(initReservation),
context.getConfig().getLong(maxAllocation));
}
+ private String getHostName() throws UnknownHostException{
+ // DRILL_HOST_NAME sets custom host name. See drill-env.sh for
details.
+ String customHost = System.getenv("DRILL_HOST_NAME");
+ if (customHost == null) {
+ return useIP ? InetAddress.getLocalHost().getHostAddress() :
InetAddress.getLocalHost().getCanonicalHostName();
+ } else {
+ return customHost;
+ }
--- End diff --
Minor code flow suggestion:
if (customHost == null) {
return customHost;
}
return useIP ? InetAddress.getLocalHost().getHostAddress() :
InetAddress.getLocalHost().getCanonicalHostName();
> Allow drillbits to advertise a configurable host address to Zookeeper
> ---------------------------------------------------------------------
>
> Key: DRILL-4935
> URL: https://issues.apache.org/jira/browse/DRILL-4935
> Project: Apache Drill
> Issue Type: New Feature
> Components: Execution - RPC
> Affects Versions: 1.8.0
> Reporter: Harrison Mebane
> Priority: Minor
> Fix For: Future
>
>
> There are certain situations, such as running Drill in distributed Docker
> containers, in which it is desirable to advertise a different hostname to
> Zookeeper than would be output by INetAddress.getLocalHost(). I propose
> adding a configuration variable 'drill.exec.rpc.bit.advertised.host' and
> passing this address to Zookeeper when the configuration variable is
> populated, otherwise falling back to the present behavior.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)