Support Questions

Find answers, ask questions, and share your expertise

The hostname and canonical name for this host are not consistent

avatar
Expert Contributor

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)
2 ACCEPTED SOLUTIONS

avatar
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

View solution in original post

avatar
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

View solution in original post

25 REPLIES 25

avatar
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

avatar
Expert Contributor

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)

avatar
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

avatar
Expert Contributor

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)

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

Regards,
Gautam Gopalakrishnan

avatar
Expert Contributor

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

Thanks,
Sathish (Satz)

avatar
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

avatar
Expert Contributor

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)

avatar
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