解决python针对hdfs上传和下载问题

版权声明:本文为博主huanbia:http://blog.csdn.net/huanbia原创文章,未经博主允许不得转载。 https://blog.csdn.net/huanbia/article/details/76575652
当我们使用python的hdfs包进行上传和下载文件的时候,总会出现如下问题
requests.packages.urllib3.exceptions.NewConnectionError:<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe87cc37c50>: Failed to establish a new connection: [Errno -2] Name or service not known

其实这主要是由于没有将各个集群节点的ip映射到/etc/hosts文件中
修改/etc/hosts文件,将各个集群节点ip映射加上即可,如博主所示
vim /etc/hosts
192.168.20.174  hadoop04
192.168.20.173  hadoop03
192.168.20.172  hadoop02
192.168.20.171  hadoop01


猜你喜欢

转载自blog.csdn.net/huanbia/article/details/76575652