Reply
Contributor
Posts: 47
Registered: ‎09-12-2014
Accepted Solution

The hostname and canonical name for this host are not consistent

Hi All,

 

When I added a new node in cloudera cluster, The node went to bad health and shows error message like "The hostname and canonical name for this host are not consistent when checked from a Java process" Can any one help us to fix this issue.

 

 

Thanks,

Sathishkumar M

Thanks,
Sathish (Satz)
Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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

If you're running Red Hat or CenOS, ensure the /etc/sysconfig/network file
has the HOSTNAME field with the FQDN, not just the host name.

HOSTNAME=server1.example.com (good)
HOSTNAME=server1 (bad)

Edit this and reboot the host. Just restarting network services might not
work. Then let us know if the error still continues to be logged.

Regards,
Gautam Gopalakrishnan
Cloudera Support
Contributor
Posts: 47
Registered: ‎09-12-2014

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

Thanks Gautam, It  is working. 

 

But, Other nodes in the same cluster dont have this FQDN in that path /etc/sysconfig/network and those are working fine.Is there any specific reason?

Thanks,
Sathish (Satz)
Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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

That is hard to say. Please run this python one-liner on a host where you
don't get complaints and on the host you just fixed. Do they look similar?

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


Regards,
Gautam Gopalakrishnan
Cloudera Support
Contributor
Posts: 47
Registered: ‎09-12-2014

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

Yes,The onliner diplaying the FQDN in both the nodes.  But we tried after removing that FQDN in /etc/sysconfig/network file also and we got the same output.

Thanks,
Sathish (Satz)
Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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

Just editing the entry won't suffice. Changes to that file need a reboot to
take effect.

Regards,
Gautam Gopalakrishnan
Cloudera Support
Contributor
Posts: 47
Registered: ‎09-12-2014

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

Thanks Gautam for your reply. We checked only after the reboot.

Thanks,
Sathish (Satz)
Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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

From what I understand, you have some hosts with HOSTNAME=server1 and some with HOSTNAME=server1.example.com. CM does not complain about all hosts which have HOSTNAME=server1. Is this right?

Are you able to provide the python script output from both types of hosts? What OS are these hosts running?
Regards,
Gautam Gopalakrishnan
Cloudera Support
Contributor
Posts: 47
Registered: ‎09-12-2014

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

Network file for that node which is in bad health before change 

cat /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=node10

 

Output of Python code

 

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

 

node10.cluster1.com

 

Network file for that node which is already in good health

 

cat /etc/sysconfig/network

 

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

 

node6.cluster1.com

 

 

 

Thanks

Sathishkumar M

 

Thanks,
Sathish (Satz)
Cloudera Employee
Posts: 576
Registered: ‎01-20-2014

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

Satish, I am failing to see the problem here. Maybe I'm missing something obvious?

You were getting warnings for node10 earlier but don't any more. Does node6 have "HOSTNAME=node6" and still doesn't generate warnings?
Regards,
Gautam Gopalakrishnan
Cloudera Support
Announcements