Hadoop - java.net.ConnectException: Connection refused

Alex picture Alex · Apr 27, 2015 · Viewed 31.3k times · Source

I want connect to hdfs (in localhost) and i have a error:

Call From despubuntu-ThinkPad-E420/127.0.1.1 to localhost:54310 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused

I follow all the steps in other posts, but i dont solve my problem. I use hadoop 2.7 and this is configurations:

core-site.xml

<configuration>
  <property>
    <name>hadoop.tmp.dir</name>
    <value>/home/despubuntu/hadoop/name/data</value>
  </property>

  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:54310</value>
  </property>
</configuration>

hdfs-site.xml

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
</configuration>

I type /usr/local/hadoop/bin/hdfs namenode -format and /usr/local/hadoop/sbin/start-all.sh

But when i type "jps" the result is:

10650 Jps
4162 Main
5255 NailgunRunner
20831 Launcher

I need help...

Answer

nikk picture nikk · Jul 22, 2016

Make sure that DFS which is set to port 9000 in core-site.xml is actually started. You can check with jps command. You can start it with sbin/start-dfs.sh