在python中使用pywebhdfs软件包时出错

时间:2019-01-08 11:14:40

标签: python python-3.x hdfs webhdfs

我正在尝试使用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命令正在运行,并给我这个错误。谁能帮助我消除此错误?

0 个答案:

没有答案