java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused

Hadoop

Lets do some basic filesystem operations. Lets copy the file /home/pandian/anthem.txt to HDFS

wpid-img_612476816780963.jpeg

$ bin/hadoop fs -copyFromLocal /home/pandian/anthem.txt hdfs://localhost/usr/pandian
copyFromLocal: Call From pandian-SH560/127.0.1.1 to localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

Yes, because we haven’t started the server yet. We should make the following changes before we start the server.

Open etc/hadoop/core-site.xml and add the following parameters under <configuration></configuration> tag.

<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000/</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>

Now, go ahead and start the server.
$ sbin/start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/pandian/hadoop-2.5.0/logs/hadoop-pandian-namenode-pandian-SH560.out
localhost: starting datanode, logging to /home/pandian/hadoop-2.5.0/logs/hadoop-pandian-datanode-pandian-SH560.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/pandian/hadoop-2.5.0/logs/hadoop-pandian-secondarynamenode-pandian-SH560.out
starting yarn daemons
starting resourcemanager, logging to /home/pandian/hadoop-2.5.0/logs/yarn-pandian-resourcemanager-pandian-SH560.out
localhost: starting nodemanager, logging to /home/pandian/hadoop-2.5.0/logs/yarn-pandian-nodemanager-pandian-SH560.out

Lets try now.

$ bin/hadoop fs -copyFromLocal /home/pandian/anthem.txt hdfs://localhost/usr/pandian
copyFromLocal:…

View original post 241 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s