【问题描述】
Cloudera Agent日志报错如下:
[22/Feb/2019 16:05:19 +0000] 15199 MainThread _cplogging INFO [22/Feb/2019:16:05:19] ENGINE Started monitor thread '_TimeoutMonitor'.
[22/Feb/2019 16:05:19 +0000] 15199 HTTPServer Thread-2 _cplogging ERROR [22/Feb/2019:16:05:19] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/process/servers.py", line 187, in _start_http_thread
self.httpserver.start()
File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/wsgiserver/wsgiserver2.py", line 1825, in start
raise socket.error(msg)
error: No socket could be created on ('sjtl-n001.esgyn.com', 9000) -- [Errno 99] Cannot assign requested address
【问题原因】
根据错误信息 HeartBeat,发现是Agent与Server通信错误,可能是IP和机器名映射问题;
通过以下python语句验证IP与HOSTNAME映射关系;
python -c 'import socket; print socket.getfqdn(), socket.gethostbyname(socket.getfqdn())'
再使用ifconfig查看IP地址,并查看/etc/hosts,发现是因为/etc/hosts中配置了外网IP导致。
【问题解决】
根据问题原因,修改/etc/hosts配置文件;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69985104/viewspace-2727531/ ,如需转载,请注明出处,否则将追究法律责任。