Xianghao Lu created AMBARI-22800:
------------------------------------
Summary: Ambari agent get wrong FQDN by getfqdn()
Key: AMBARI-22800
URL: https://issues.apache.org/jira/browse/AMBARI-22800
Project: Ambari
Issue Type: Bug
Components: ambari-agent
Affects Versions: trunk
Reporter: Xianghao Lu
Ambari agent sometimes get a wrong FQDN by python function socket.getfqdn(),
for example, host uses the /_etc_/_hosts_ file to resolve hostname to IP
addresses, as a result, Ambari agent will register failed. My case is as
follows:
[root@test ~]$ hostname
test.example.com
[root@test ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain
10.208.47.45 a01
[root@test ~]$ python
Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> print socket.getfqdn()
a03
Agent error log:
ERROR 2018-01-17 15:52:29,774 main.py:244 - Ambari agent machine hostname (a01)
does not match expected ambari server hostname (test.example.com). Aborting
registration. Please check
hostname, hostname -f and /etc/hosts file to confirm your hostname is setup
correctly
Related Links:
https://bugs.python.org/issue5004
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)