[
https://issues.apache.org/jira/browse/FLINK-7198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16094356#comment-16094356
]
Chesnay Schepler commented on FLINK-7198:
-----------------------------------------
It must be set, if it isn't the JobManager doesn't even start:
{{JobManager#main}}:
{code}
// we want to check that the JobManager hostname is in the config
// if it is not in there, the actor system will bind to the loopback
interface's
// address and will not be reachable from anyone remote
if (externalHostName == null) {
val message = "Config parameter '" + JobManagerOptions.ADDRESS.key() +
"' is missing (hostname/address to bind JobManager to)."
LOG.error(message)
System.exit(STARTUP_FAILURE_RETURN_CODE)
}
{code}
The code works as I intended, to expose the host for which the actor system is
reachable. I figured that this is the only host address we can expose for which
we can guarantee that it has some relevance to the job, and really didn't want
to start the "pick-the-correct-network-interface" game.
For TaskManagers I _assumed_ we did the same (maybe we did back then), I just
looked through the TaskManager code. Here we take the {{InetAddress}} returned
by {{InetAddress.getByName("localhost")}} and pass it to the
{{TaskManagerLocation}} constructor which does this:
{code}
// get FQDN hostname on this TaskManager.
String fqdnHostName;
try {
fqdnHostName = this.inetAddress.getCanonicalHostName();
}
catch (Throwable t) {
LOG.warn("Unable to determine the canonical hostname.
Input split assignment (such as " +
"for HDFS files) may be non-local when
the canonical hostname is missing.");
LOG.debug("getCanonicalHostName() Exception:", t);
fqdnHostName = this.inetAddress.getHostAddress();
}
this.fqdnHostName = fqdnHostName;
if
(this.fqdnHostName.equals(this.inetAddress.getHostAddress())) {
// this happens when the name lookup fails, either due
to an exception,
// or because no hostname can be found for the address
// take IP textual representation
this.hostName = this.fqdnHostName;
LOG.warn("No hostname could be resolved for the IP
address {}, using IP address as host name. "
+ "Local input split assignment (such
as for HDFS files) may be impacted.",
this.inetAddress.getHostAddress());
}
else {
this.hostName =
NetUtils.getHostnameFromFQDN(this.fqdnHostName);
}
{code}
{{this.hostName}} is then exposed as the host.
For consistency purposes I would propose to do the same for the JobManager.
> Metric Reporters report incorrect host for JobManager
> -----------------------------------------------------
>
> Key: FLINK-7198
> URL: https://issues.apache.org/jira/browse/FLINK-7198
> Project: Flink
> Issue Type: Bug
> Components: Metrics
> Affects Versions: 1.3.1
> Environment: RHEL 7.3, Mesos 1.3, Datadog
> Reporter: Robert Batts
> Priority: Minor
>
> When using the Datadog Metric Reporter with a Mesos deployed Flink 1.3.1
> cluster the JobManager is reported to Datadog with a tag of host:127.0.0.1.
> The TaskManagers report with the correct tag (i.e. host:mesos-02.place.com),
> so this just appears to be an issue with the way host information is gathered
> for Datadog.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)