无法以伪分布模式连接到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。

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