在python中使用pywebhdfs包时出错

2024-06-03 11:57:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用Spyder中的pywebhdfs模块直接与hdfs交互以列出文件和文件夹。我已建立到服务器的连接。我的代码是:

from pywebhdfs.webhdfs import PyWebHdfsClient
from pprint import pprint
hdfs=PyWebHdfsClient(host='10.242.245.199',port='50070',
                     user_name='s733390')
my_dir = 'user/s733390'
pprint(hdfs.list_dir(my_dir))

但是当我运行这个代码时,我得到了一个错误:

PyWebHdfsException: b'<HEAD><TITLE>internal error - server connection terminated</TITLE></HEAD>\n<BODY BGCOLOR="white" FGCOLOR="black"><H1>internal error - server connection terminated</H1><HR>\n<FONT FACE="Helvetica,Arial"><B>\nDescription: internal error - server connection terminated</B></FONT>\n<HR>\n<!-- default "internal error - server connection terminated" response (502) -->\n</BODY>\n \x00'

没有其他hdfs命令工作,并给我这个错误。有人能帮我删除这个错误吗?你知道吗


Tags: 代码fromimportserver错误direrrorhdfs