Reply
New Contributor
Posts: 5
Registered: ‎01-14-2017

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

Hi ,  I also had the same issue in RHEL 7 . As suggested I modified the "HOSTNAME" attribute in /etc/sysconfig/network file to FQDN. Following that I also modified the hostname to FQDN using the following command:

hostnamectl set-hostname "<your hostname FQDN>" --static 

Followed by this  I restarted cloudera-scm-agent . This worked for me , there were no more critical warnings on hostname and canonical hostname .

New Contributor
Posts: 3
Registered: ‎06-21-2017

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

The python command should be all one line, or use a "\" to continue on a new line.

For example:

$ python -c "import socket; print socket.getfqdn(); print socket.gethostbyname(socket.getfqdn())"

or
$ python -c "import socket; print socket.getfqdn(); \
print socket.gethostbyname(socket.getfqdn())"

New Contributor
Posts: 9
Registered: ‎07-01-2017

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

[ Edited ]

I am having same problem here.

I used to install Cloudera Manager on Centos 7 with no issues.

But in Centos 6(since impala is not supported on Centos 7, had to try Centos 6), getting this error on all hosts. 

My /etc/sysconfig/network file is like this:

 

$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=cixa.c.gib-data.internal

I rebooted all hosts after setting HOSTNAME in /etc/sysconfig/network file.

All other nodes share same configuration. 

Host inspection gives no warning.

 

In host status, this error message is shown:

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

 

$ python -c "import socket; print socket.getfqdn(); print socket.gethostbyname(socket.getfqdn())"
cixa.c.gib-data.internal
10.128.0.2

All hosts answer correctly to nslookup and host commands.

All hosts can shh and ping to all others with FQDN.

Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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


rampo wrote:
But in Centos 6(since impala is not supported on Centos 7, had to try Centos 6), getting this error on all hosts.

 

 

This is not true, our latest versions of CDH do run on CentOS 7 which means Impala is supported on it as well.

e.g. 5.11.1

https://www.cloudera.com/documentation/enterprise/release-notes/topics/cdh_vd_cdh_download_511.html

Regards,
Gautam Gopalakrishnan
Cloudera Support
New Contributor
Posts: 9
Registered: ‎07-01-2017

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

I have installed Cloudera Manager 5.11 on CentOS7. Unfortunately on Parcels page, it says:

Impala is not supported on RHEL 7.

That's the whole reason I fallback to CenOS 6.

 

Also when I check Impala Parcels on http://archive.cloudera.com/impala/parcels/latest/ I see there is no EL7 parcel.

Here is the complete list of Impala parcels:

 

IMPALA-2.1.0-1.impala2.0.0.p0.1995-el5.parcel
IMPALA-2.1.0-1.impala2.0.0.p0.1995-el6.parcel
IMPALA-2.1.0-1.impala2.0.0.p0.1995-lucid.parcel
IMPALA-2.1.0-1.impala2.0.0.p0.1995-precise.parcel
IMPALA-2.1.0-1.impala2.0.0.p0.1995-sles11.parcel
IMPALA-2.1.0-1.impala2.0.0.p0.1995-squeeze.parcel

 

 

Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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


@rampo wrote:
Also when I check Impala Parcels on http://archive.cloudera.com/impala/parcels/latest/ I see there is no EL7 parcel.

I'm glad you mentioned the parcel repo. With the latest releases of CDH, Impala is included in the CDH parcel itself and doesn't need a separate repository. The current version of Impala in CDH 5.11.1 is 2.8.0, see this URL: https://www.cloudera.com/documentation/enterprise/release-notes/topics/cdh_vd_cdh_package_tarball_51...

 

So this means, if you're able to create a CDH cluster on a bunch of CentOS 7 hosts, you should be able to add the Impala service as well. Please don't add that parcel quoted above as it's not required any longer.

Regards,
Gautam Gopalakrishnan
Cloudera Support
New Contributor
Posts: 9
Registered: ‎07-01-2017

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

Thank you @GautamG

I wasn't aware of that until you clearly stated that.

 

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

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

[ Edited ]

error still persists even after restarting

am using centOs 6

 

 

[root@instance-1 Admin]# hostname -f
instance-1.c.sacred-evening-197206.internal
[root@instance-1 Admin]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=instance-1.c.sacred-evening-197206.internal
[root@instance-1 Admin]#

 

 

what to do kindly suggest.

 

Posts: 866
Topics: 1
Kudos: 200
Solutions: 107
Registered: ‎04-22-2014

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

hi @prabhat10,

 

Since this is an old thread, we should make sure you are indeed seeing the same issue that is described.

Please let us know what you are doing when you see the problem and what the problem is.

 

If you are seeing the message that is in the initial comment of this thread, then to get some more insight, I recommend running the DNSTest manually like this on a cluster host:

(make sure java is in your path or specify the full path to the java file)

 

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

 

The output will be a JSON format file like this:

 

{"status": "0", "ip": "122.168.100.211", "hostname": "host.example.com", "canonicalname": "host.example.com", "localhostDuration": "4", "canonicalnameDuration": "0" }

 

This might shed some light on what is going on.  I'd check your hosts file or DNS depending on how your host resolution is configured on that host.

 

Regards,

 

Ben

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

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

[ Edited ]

hello@bgooley

 

i have run this command 

# 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-1 Admin]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=instance-1.c.sacred-evening-197206.internal

 

[root@instance-1 Admin]# java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-b10)
OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
[root@instance-1 Admin]# javac -version
bash: javac: command not found

 

 

do i need to run the above command on each hosts and other hosts java is not installed, do i need to instaal it manually. On doing java -version its showing command not found.

 

[root@instance-1 jdk1.7.0_67-cloudera]# alternatives --display java| grep Current
Current `best' version is /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java.
[root@instance-1 jdk1.7.0_67-cloudera]# ls /usr/java/
jdk1.7.0_67-cloudera
[root@instance-1 jdk1.7.0_67-cloudera]# ls /usr/java/jdk1.7.0_67-cloudera/
bin lib src.zip
COPYRIGHT LICENSE THIRDPARTYLICENSEREADME-JAVAFX.txt
db man THIRDPARTYLICENSEREADME.txt
include README.html
jre release

 

kindly suggest!!

Announcements