我正在尝试在OSXYosemite上运行hadoop。当我按照http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/singlecluster.html,我配置了hadoop,并启动了$sbin/start-dfs.sh,然后与jps检查得到了输出:
17237 DataNode
17324 SecondaryNameNode
17388 Jps
但是,当我尝试“bin/hdfs dfs-mkdir/user”时,hadoop无法加载库(在运行其他示例时也会发生同样的情况),并显示失败的连接:
$ bin/hdfs dfs -mkdir /user
15/01/05 03:19:35 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
mkdir: Call From *.local/192.*.*.* to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
1条答案
按热度按时间fkaflof61#
看来namenode没有运行。在hdfs中,namenode充当主守护进程,负责hdfs客户机的所有请求。namenode应该在执行start-dfs.sh脚本时启动。在启动hdfs服务之前,请检查是否已格式化hdfs,如果未格式化hdfs,请使用以下命令格式化hdfs,并使用stop-dfs.sh和start-dfs.sh命令再次停止和启动hdfs服务