('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

Viewed 4505

I'm trying to connecting to HDFS in python code that I write in Jupyternotebook:

    from hdfs import InsecureClient

    client_hdfs = InsecureClient('host/:port', user='marina.i')
    with client_hdfs.read('/user-data/.csv', encoding = 'utf-8') as reader:
        df = pd.read_csv(reader,index_col=0)  

I'm getting an error:

ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

During handling of the above exception, another exception occurred:

1 Answers

You need to specify real HDFS_URL as the first parameter of InsecureClient.

Related