0

I have installed a single node Hadoop on my local computer with Ubuntu 14.04 OS. Now I am going to use HDFS, and when I type a simple command

hdu@hadoop:~$ hadoop fs -ls

it shows up the following errors:

15/07/10 18:24:52 WARN util.NativeCodeLoader: 
Unable to load native-hadoop library for your platform... 
using builtin-java classes where applicable
ls: Call From hadoop/127.0.1.1 to 
localhost:9000 failed on connection exception: 
java.net.ConnectException: 
Connection refused; For more details see:
http://wiki.apache.org/hadoop/ConnectionRefused

I have no ideas about this error, and I really appreciate if anyone helps me fix the problem :)

Ruofan Kong
  • 1,060
  • 1
  • 17
  • 34

2 Answers2

1

Did you actually start your namenode service? Formatting the namenode doesn't actually start the namenode service. If your namenode service is running then perhaps you are running into the Ubuntu issue referenced in the link in the error.

From: http://wiki.apache.org/hadoop/ConnectionRefused

Check that there isn't an entry for your hostname mapped to 127.0.0.1 or 127.0.1.1 in /etc/hosts (Ubuntu is notorious for this)

Cody Stevens
  • 424
  • 4
  • 9
  • The answer is really helpful! I think my problem mainly comes from not starting my namenode service although I formatted it. Now the problem is solved. Thanks a lot for your great answer!!! – Ruofan Kong Jul 12 '15 at 20:52
1

You can try these commands!

# su - hadoop
$ cd /opt/hadoop/hadoop
$ bin/hadoop namenode -format

$ bin/start-all.sh
Rachit Ahuja
  • 371
  • 2
  • 15