Support Questions

Find answers, ask questions, and share your expertise

hostname and canonical name for this host are not consistent when checked from a Java process

avatar
Explorer

i have run this command on all hosts

# java -classpath /usr/share/cmf/lib/agent-5.*.jar com.cloudera.cmon.agent.DnsTest

 

and get this as a output :

[root@instance-1 Admin]# java -classpath /usr/share/cmf/lib/agent-5.*.jar com.cloudera.cmon.agent.DnsTest
{"status": "0", "ip": "10.142.0.4", "hostname": "instance-1", "canonicalname": "instance-1.c.sacred-evening-197206.internal", "localhostDuration": "4", "canonicalnameDuration": "0" }

 

[root@instance-2 Admin]# java -classpath /usr/share/cmf/lib/agent-5.*.jar com.cloudera.cmon.agent.DnsTest
{"status": "0", "ip": "10.142.0.5", "hostname": "instance-2", "canonicalname": "instance-2.c.sacred-evening-197206.internal", "localhostDuration": "5", "canonicalnameDuration": "0" }

 

[root@instance-3 Admin]# java -classpath /usr/share/cmf/lib/agent-5.*.jar com.c loudera.cmon.agent.DnsTest
{"status": "0", "ip": "10.142.0.2", "hostname": "instance-3", "canonicalname": " instance-3.c.sacred-evening-197206.internal", "localhostDuration": "4", "canonic alnameDuration": "0" }

 

but in my /etc/sysconfig/network and /etc/hosts file i have mentioned FQDN then why its showing instance-1, instance-2, instance-3 while running above command.

 

please suggest

17 REPLIES 17

avatar
Expert Contributor

I had this problem in the past.  Turns out a DNA record was set up correctly.  Try doing a nslookup on the machine to get ip, then do a nslookup on the IP.  Ensure both the machine names displayed are the same

avatar
Expert Contributor

I tried doing it. Indeed they match

avatar
Explorer

I am having similar issue. We are using cloudera on GCP VM using Centos 7.

 

The problem is even when i have set the hostname to FQDN using hostname from root, looks like gcp reverts back the hostname to shortname causing the dnsTest to fail. Does anyone knows how to resolve this problem? Seems google is running a cron job that sets the hostname to short name.

avatar
Expert Contributor

It happened to us when we ported our servers from AWS to GCP using cloud endure. Created GCP VM instance directly and it got fixed.

avatar
Explorer

We did not use endure, we are creating new GCP VMs using terraform and installing fresh cloudera manager on top of it. However, the hostname keeps changing to shortname even after setting the hostname to fqdn manually.

avatar
Expert Contributor

sad. Basically, hostname gets reset on network restart that happens every few hours in GCP hence the issue. GCP support suggested us to reset it using cron but that completely f**ed up our server communication. Suggest you to get in touch with GCP support since Cloudera or any other entity won't be able to help with this as far as I know

avatar
Explorer

Thanks much for the response. We are thinking of creating a cron job that sets it back, but agree it may impact our cluster. We will get in touch with GCP support to understand alternatives. Thank you.

avatar
Expert Contributor

Setting the cron job will take this particular error away but eventually, you are bound to run into a lot of other issues.

 

Feel free to try though. Also, let me know your experience after trying that 🙂