Hi ! I want to understand how Pinot decides whethe...
# troubleshooting
s
Hi ! I want to understand how Pinot decides whether to use hostnames or IP addresses in a component’s name
m
There’s a server config:
pinot.set.instance.id.to.hostname
that defaults to false.
s
We have it set to true. Another behaviour we noticed was that the component names sometimes change to hostnames or IPs on service restarts without any change in confs. This can cause the Cluster to identify the same server as a new component
m
Copy code
/**
   * Get the hostname or IP address.
   *
   * @return The hostname if available, otherwise a dotted quad address. Returns null if neither can be determined.
   */
  public static String getHostnameOrAddress() {
    try {
      return InetAddress.getLocalHost().getCanonicalHostName();
    } catch (UnknownHostException ignored) {
      try {
        return getHostAddress();
      } catch (Exception e) {
        return null;
      }
    }
  }
Looks like it can happen if
InetAddress.getLocalHost().getCanonicalHostName()
throws an exception, then it will default to host address
s
I see. This helps a lot. We did notice the change while the hostname/dns were changed on server but a few times else too
Like this over here. These two are same physical servers but I edited the hostname on server from max-reporting-3.srv.media.net.novalocal to max-reporting-3.srv.media.net and the service restart after that changed the component name to IP
Could it be how jvm fetches the hostname from the physical host ? Perhaps jvm would require host reboot or something to fetch new hostname
m
I think there is probably a setting that allows you to pick the host name of you choice
p
Anyway safe way to clean up the duplicate entires for brokers one with ip address and the other with hostname? The remove instance rest endpoint seems to think its in used even if its not active.