我在我的 Ubuntu 单节点集群上使用 Hadoop 2.2。我已经使用 start-all.sh 启动了 hadoop 集群。当我尝试在 HDFS 中加载文本文件时,它会引发以下错误。
hduser@ubuntu:~$ hadoop dfs -put /home/aditya/Desktop/data.txt
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
13/11/26 00:40:44 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
put: Call From ubuntu/127.0.1.1 to localhost:54310 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
这些是我的/etc/hosts 文件详细信息。请检查。
127.0.0.1 localhost
127.0.1.1 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
我搜索并尝试解决此错误,但没有成功。请帮我谈谈你的想法。谢谢你。
最佳答案
你用的是什么版本的hadoop?
集群中有多少个节点?
您看到的错误通常是由/etc/hosts 设置引起的。确保所有盒子都可以通过名称相互 ping 通。
我已删除所有主机名到 127.0.1.1 的映射,并将主机名绑定(bind)到我们小型 2 节点集群(hadoop 2.2.0)中的 IP。
…………
请查看/etc/hosts 设置的 stackoverflow 链接。
Hadoop (local and host destination do not match) after installing hive
我强烈建议查看下面链接的 Hadoop2 设置文档,因为有几件事发生了变化。
关于apache - 无法为您的平台加载 native-hadoop 库(Ubuntu 12.04)错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20201403/