waqas
waqas

Reputation: 1125

8021 failed on connection exception: java.net.ConnectException: Connection refused at org.apache.hadoop.ipc.Client.wrapException(Client.java:1095)

Hi I am trying to configure Hadoop 1.0. in pseudodistributed mode by following this blog.

http://hadoop-tutorial.blogspot.de/2010/11/running-hadoop-in-pseudo-distributed.html?showComment=1337083501000#c615470573579885293.

But when I run the pi example given in the hadoop distribution, I get the error mentioned in title. Can someone please help me and guide me how can I fix this problem. Also its a request that please suggest solution as well if possible along with pinpinting the problem.

here is what i get by running jps

8322 Jps
7611 SecondaryNameNode
7474 DataNode
7341 NameNode

Here is complete error message.

Number of Maps  = 10
Samples per Map = 100
Wrote input for Map #0
Wrote input for Map #1
Wrote input for Map #2
Wrote input for Map #3
Wrote input for Map #4
Wrote input for Map #5
Wrote input for Map #6
Wrote input for Map #7
Wrote input for Map #8
Wrote input for Map #9
Starting Job
12/05/16 13:11:56 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 0 time(s).
12/05/16 13:11:57 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 1 time(s).
12/05/16 13:11:58 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 2 time(s).
12/05/16 13:11:59 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 3 time(s).
12/05/16 13:12:00 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 4 time(s).
12/05/16 13:12:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 5 time(s).
12/05/16 13:12:02 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 6 time(s).
12/05/16 13:12:03 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 7 time(s).
12/05/16 13:12:04 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 8 time(s).
12/05/16 13:12:05 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8021. Already tried 9 time(s).
java.net.ConnectException: Call to localhost/127.0.0.1:8021 failed on connection exception: java.net.ConnectException: Connection refused
        at org.apache.hadoop.ipc.Client.wrapException(Client.java:1095)
        at org.apache.hadoop.ipc.Client.call(Client.java:1071)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
        at org.apache.hadoop.mapred.$Proxy2.getProtocolVersion(Unknown Source)
        at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
        at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
        at org.apache.hadoop.mapred.JobClient.createRPCProxy(JobClient.java:480)
        at org.apache.hadoop.mapred.JobClient.init(JobClient.java:474)
        at org.apache.hadoop.mapred.JobClient.<init>(JobClient.java:457)
        at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1260)
        at org.apache.hadoop.examples.PiEstimator.estimate(PiEstimator.java:297)
        at org.apache.hadoop.examples.PiEstimator.run(PiEstimator.java:342)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.hadoop.examples.PiEstimator.main(PiEstimator.java:351)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
        at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
        at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
        at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
        at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:656)
        at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:434)
        at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:560)
        at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:184)
        at org.apache.hadoop.ipc.Client.getConnection(Client.java:1202)
        at org.apache.hadoop.ipc.Client.call(Client.java:1046)
        ... 24 more

Upvotes: 1

Views: 16917

Answers (4)

GotJazz
GotJazz

Reputation: 49

From the jps output looks like the TaskTracker and JobTracker are not running. Try running:

start-mapred.sh 

This would start the TaskTracker and JobTracker and try rerunning job.

Upvotes: 0

Haiping Fan
Haiping Fan

Reputation: 569

i met same issue, it is becasue hadoop 1.0.x has a difference need config two variables in hadoop_env.sh:

export HADOOP_HEAPSIZE=2000

Extra Java runtime options. Empty by default.

export HADOOP_OPTS=-server

export HADOOP_OPTS="-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk"

when you add these two variables, you will not see any error or warning during starting daemons, so that you can resolve your issue. good luck!

wish my answer can help other guys:)

Upvotes: 0

Tejas Patil
Tejas Patil

Reputation: 6169

Looks like this is some connection related issue. Is your jobtracker and trasktracker running correctly ?

See this link

Edit:

Read the Appendix A here in Definitive Guide. Its has entire steps for setting up a hadoop server in all 3 modes. I think that your configurations might be creating problems so use those that are prescribed in the book. Also check if password-less SSH is working fine on yr setup.

Upvotes: 0

Chris White
Chris White

Reputation: 30089

Your jps output shows that you do not have a JobTracker nor TaskTracker running - hence the connection issue when trying to communicate with the jobtracker.

Check the logs for the jobtracker ($HADOOP_HOME/logs/*.jobtracker*.log) to see if there is an error message describing why it hasn't started (how did you start the cluster - start-all.sh or start-dfs.sh, maybe try running start-mapred.sh to see if that starts up your map reduce services)?

Upvotes: 3

Related Questions