Yash Bhatia
Yash Bhatia

Reputation: 3

hadoop fs -ls : Call From server/127.0.1.1 to localhost failed

I have hadoop installed in pseudo-distributed mode.

When running the command

hadoop fs -ls

I am getting the following error:

ls: Call From kali/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

Any suggestions?

Upvotes: 0

Views: 2159

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191691

If you read the link in the error, I see two immediate points that need addressed.

If the error message says the remote service is on "127.0.0.1" or "localhost" that means the configuration file is telling the client that the service is on the local server. If your client is trying to talk to a remote system, then your configuration is broken.

You should treat pseudodistributed mode as a remote system, even if it is only running locally.

For HDFS, you can resolve that by putting your computer hostname (preferably the full FQDN for your domain), as the HDFS address in core-site.xml. For your case, hdfs://kali:9000 should be enough

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).

I'm not completely sure why it needs removed, but the general answer I can think of is that Hadoop is a distributed system, and as I mentioned, treat the pseudodistributed mode as if it's remote HDFS server. Therefore, no loopback addresses should use your computers hostname

For example, remove the second line of this

127.0.0.1 localhost
127.0.1.1 kali

Or remove the hostname from this

127.0.0.1 localhost kali

Most importantly (emphasis added)

None of these are Hadoop problems, they are hadoop, host, network and firewall configuration issues

Upvotes: 1

Related Questions