Linux – Can’t connect to HDFS in pseudo-distributed mode

hadoophbasehdfslinux

I followed the instructions here for installing hadoop in pseudo-distributed mode.

However, I'm having trouble connecting to HDFS.

When I execute this command :

./hadoop fs -ls /

I get a directory listing just like I should.

However, when I execute this command :

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

I get this :

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

If I browse here :

http://localhost:50070/dfshealth.jsp

I get the NameNode system health page, just like I should. However, if I follow the link that says "Browse the filesystem" which I believe goes here :

http://localhost:50070/nn_browsedfscontent.jsp

I get a 404 page from Jetty.

Don't know if the two things are related, but this is definitely blocking me. I'm trying to set up hbase in pseudo-distributed mode as outlined here, but I can't because hbase can't connect to hdfs on port 8020.

INFO

I'm running hadoop .20 and hbase .90.6 on CENTOS 6.2.

Hadoop and hbase start on boot-up, from init.d scripts that I wrote.

Hadoop is running under the hadoop user, and is located in /opt/hadoop. In the hadoop init.d script, I execute start-all.sh using the daemon command.

HBase is running under root, and is located in /opt/hbase. In the hbase init.d script, I execute the start-hbase.sh script. Currently I'm running HBase in standalone mode.

Best Answer

Looks like I had mistakenly set fs.default.name to 9000. Changed it to 8020, now everything works fine. Thanks to mgorven for the help!