cloudera-scm-agent启动后日志中发现异常

[30/Mar/2018 14:03:07 +0000] 1879772 MainThread agent INFO Setting default socket timeout to 45
[30/Mar/2018 14:03:07 +0000] 1879772 MainThread agent ERROR Heartbeating to 10.0.35.90:None failed.
Traceback (most recent call last):
File "/app/cloudera/cm-5.14.0/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.14.0-py2.6.egg/cmf/agent.py", line 1419, in _send_heartbeat self.master_port)
File "/app/cloudera/cm-5.14.0/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 469, in __init__self.conn.connect()
File "/usr/lib64/python2.6/httplib.py", line 742, in connect self.timeout)
File "/usr/lib64/python2.6/socket.py", line 567, in create_connection raise error, msg error: [Errno 111] Connection refused

源代码

#/app/cloudera/cm-5.14.0/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.14.0-py2.6.egg/cmf/agent.py:1419

def _send_heartbeat(self, heartbeat):
if self.args.standalone:
# Write heartbeats to a file
if not self.heartbeat_output:
self.heartbeat_output = avro.datafile.DataFileWriter(
open(os.path.join(self.dir, "heartbeats.avro"), "w"),
avro.io.DatumWriter(),
HEARTBEAT_REQUEST_SCHEMA)
self.heartbeat_output.append(heartbeat)
self.heartbeat_output.flush()
# Read expected processes
datum_reader = avro.io.DatumReader()
dfr = avro.datafile.DataFileReader(open(self.args.standalone), datum_reader)
response = dfr.next()
else:
try:
if self.requestor is None:
if self.use_tls:

transceiver = cmf.https.HTTPSTransceiver(self.master_host,
self.master_port,
self.verify_cert_file,
self.verify_cert_dir,
self.client_key_file,
self.client_cert_file,
self.client_keypw_file,
self.client_keypw_cmd,
self.max_cert_depth)
else:
transceiver = avro.ipc.HTTPTransceiver(self.master_host, self.master_port) //1419

self.requestor = avro.ipc.Requestor(MASTER_AGENT_PROTOCOL, transceiver)
LOG.debug("Sending heartbeat to master.")
assert self.requestor is not None

 

#/app/cloudera/cm-5.14.0/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 469

class HTTPTransceiver(object):
"""
A simple HTTP-based transceiver implementation.
Useful for clients but not for servers
"""
def __init__(self, host, port, req_resource='/'):
self.req_resource = req_resource
self.conn = httplib.HTTPConnection(host, port)
self.conn.connect()

# read-only properties
sock = property(lambda self: self.conn.sock)
remote_name = property(lambda self: self.sock.getsockname())

#File "/usr/lib64/python2.6/httplib.py", line 742, in connect self.timeout)

def connect(self):
"""Connect to the host and port specified in __init__."""
self.sock = socket.create_connection((self.host,self.port),
self.timeout)

if self._tunnel_host:
self._tunnel()

#  File "/usr/lib64/python2.6/socket.py", line 567, in create_connectio

def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
"""Connect to *address* and return the socket object.

Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used.
"""

msg = "getaddrinfo returns an empty list"
host, port = address
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
sock.connect(sa)
return sock

except error, msg:
if sock is not None:
sock.close()

raise error, msg

#agent进程使用本地python2.6包和cm-5.14.0自带的python2.6程序包 

 

posted @ 2018-03-30 15:27  越滚越大雪球  阅读(878)  评论(0)    收藏  举报