无法以伪分布式模式连接到 HDFS

无法以伪分布式模式连接到 HDFS

我按照说明这里用于以伪分布式模式安装Hadoop。

但是,我无法连接到 HDFS。

当我执行此命令时:

./hadoop fs -ls /

我得到了应有的目录列表。

但是,当我执行此命令时:

./hadoop fs -ls hdfs://localhost/

我明白了:

12/08/23 15:29:58 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 0 time(s).
12/08/23 15:29:59 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 1 time(s).
12/08/23 15:30:00 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 2 time(s).
12/08/23 15:30:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 3 time(s).
12/08/23 15:30:02 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 4 time(s).
12/08/23 15:30:03 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 5 time(s).
12/08/23 15:30:04 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 6 time(s).
12/08/23 15:30:05 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 7 time(s).
12/08/23 15:30:06 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 8 time(s).
12/08/23 15:30:07 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 9 time(s).
ls: Call to localhost/127.0.0.1:8020 failed on connection exception: java.net.ConnectException: Connection refused

如果我在这里浏览:

http://localhost:50070/dfshealth.jsp

我得到了 NameNode 系统健康页面,正如我应该得到的一样。但是,如果我点击“浏览文件系统”链接,我认为它会显示在这里:

http://localhost:50070/nn_browsedfscontent.jsp

我从 Jetty 收到一个 404 页面。

不知道这两件事是否有关联,但这肯定阻碍了我。我正在尝试按照概述以伪分布式模式设置 HBase这里,但是我不能,因为 hbase 无法连接到端口 8020 上的 hdfs。

信息

我在 CENTOS 6.2 上运行 Hadoop .20 和 hbase .90.6。

Hadoop 和 hbase 在启动时从我编写的 init.d 脚本启动。

Hadoop 在 hadoop 用户下运行,位于 /opt/hadoop。在 hadoop init.d 脚本中,我使用 daemon 命令执行 start-all.sh。

HBase 在 root 下运行,位于 /opt/hbase。在 hbase init.d 脚本中,我执行 start-hbase.sh 脚本。目前我在独立模式下运行 HBase。

答案1

看来我错误地将 fs.default.name 设置为 9000。将其更改为 8020,现在一切正常。感谢 mgorven 的帮助!

相关内容