Connection refused while trying to save data into hdfs

Viewed 17

I'm trying to save data into hdfs with python, so i tired this code :

from hdfs import InsecureClient 

Client = InsecureClient('http://localhost/50070', user= 'root')
data = pd.read_csv('New_data.csv')
with client.write('/tmp/New_data.csv') as writer : 
data.to_csv(writer)

But i get an error :

HTTPConnectionPool(host=localhost', port=80)  : Max retries exceeded with url : /50070/webhdfs/v1/?user .. Failed to establish a new connection
0 Answers
Related