Reply
Explorer
Posts: 20
Registered: ‎05-21-2018

Re: The hostname and canonical name for this host are not consistent

[ Edited ]

 

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.

 

 

What to do next kindly suggest.

Explorer
Posts: 20
Registered: ‎05-21-2018

Re: The hostname and canonical name for this host are not consistent

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.

 

What to do next?

 

Kindly suggest

Posts: 696
Topics: 1
Kudos: 162
Solutions: 87
Registered: ‎04-22-2014

Re: The hostname and canonical name for this host are not consistent

@prabhat10, I'm sorry that I couldn't reply sooner.

 

The DnsTest command is what Cloudera Manager runs to check your host and canonical host names.

The problem is that your hostname and canonical names are not the same:

 

"hostname": "instance-1",

"canonicalname": "instance-1.c.sacred-evening-197206.internal

 

My guess is this has to do with your /etc/hosts file or general DNS resolution

 

Have you defined the host in /etc/hosts?

If so, make sure it is in the following format:

 

IP  FQDN

 

The FQDN name must be first

 

 

Highlighted
Explorer
Posts: 6
Registered: ‎03-31-2018

Re: The hostname and canonical name for this host are not consistent

What am I doing wrong? How can I correct this?
1. DNS Resolution Error
2. Job History Server Web UI going to

"This site can’t be reached
instance-1.c.1345678.internal’s server IP address could not be found."


hostname -f
instance-1.c.12345678.internal

cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.123.0.2 instance-1.12345678.internal instance-1 # Added by Google
123.456.789.012 metadata.google.internal # Added by Google

cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost

python -c "import socket; print socket.getfqdn(); print socket.gethostbyname(socket.getfqdn())";
instance-1.c.12345678.internal
10.123.0.2

ifconfig eth0 | grep "inet addr"
inet addr:10.123.0.2 Bcast:10.123.0.2 Mask:255.255.255.255

Posts: 696
Topics: 1
Kudos: 162
Solutions: 87
Registered: ‎04-22-2014

Re: The hostname and canonical name for this host are not consistent

@Genthandsome,

 

Hi,

 

I see you are posting on a lot of different old threads.  In the future, please create a new thread and explain the issue you are seeing like you did here.  Thank you.

 

If you google "server IP address could not be found" you will find information that helps point you in the right direction about what that means.  You are getting that in Chrome, I presume, so I also guess that you are attempting to connect to the Job History Server UI from a browser that is on a different host than nstance-1.c.12345678.internal

 

That means your local host (where your browser is installed) cannot resolve the hostname "nstance-1.c.12345678.internal".  You will need to ensure your client host has hosts file or DNS configured to allow it to resolve the host to IP address.

 

 

Announcements