- 论坛徽章:
- 1
|
大侠们看看,我这里出什么问题了:
hadoop版本: hadoop-3.0.0-alpha2
python版本: 3.5.2
谢谢大家了!
>>> from pyhdfs import HdfsClient
>>> client=HdfsClient(hosts='localhost:50070')
>>> print(client.list_status('/'))
Failed to reach to localhost:50070 (attempt 2/2)
Traceback (most recent call last):
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 83, in create_connection
raise err
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/python3.5.2/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/local/python3.5.2/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/local/python3.5.2/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/local/python3.5.2/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/local/python3.5.2/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 166, in connect
conn = self._new_conn()
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x2adee34d30f0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=50070): Max retries exceeded with url: /webhdfs/v1/?op=LISTSTATUS&user.name=hadoop (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x2adee34d30f0>: Failed to establish a new connection: [Errno 111] Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/python3.5.2/lib/python3.5/site-packages/pyhdfs.py", line 360, in _request
params=kwargs, timeout=self.timeout, allow_redirects=False,
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/python3.5.2/lib/python3.5/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=50070): Max retries exceeded with url: /webhdfs/v1/?op=LISTSTATUS&user.name=hadoop (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x2adee34d30f0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python3.5.2/lib/python3.5/site-packages/pyhdfs.py", line 525, in list_status
_json(self._get(path, 'LISTSTATUS', **kwargs))['FileStatuses']['FileStatus']
File "/usr/local/python3.5.2/lib/python3.5/site-packages/pyhdfs.py", line 381, in _get
return self._request('get', *args, **kwargs)
File "/usr/local/python3.5.2/lib/python3.5/site-packages/pyhdfs.py", line 378, in _request
raise HdfsNoServerException("Could not use any of the given hosts")
pyhdfs.HdfsNoServerException: Could not use any of the given hosts
|
|