Monday, March 30, 2015

org.apache.hadoop.mapred.YarnChild: Exception running child : Connection refused

I got the following error (in Hadoop user logs) while trying to run Mahout map reduce job in Hadoop (fully distribution mode):

2015-03-25 08:31:52,858 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : Call From to failed on connection exception: Connection refused; For more details see:
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
    at java.lang.reflect.Constructor.newInstance(
    at org.apache.hadoop.ipc.WritableRpcEngine$Invoker.invoke(
    at com.sun.proxy.$Proxy7.getTask(Unknown Source)
    at org.apache.hadoop.mapred.YarnChild.main(
Caused by: Connection refused
    at Method)
    at org.apache.hadoop.ipc.Client$Connection.setupConnection(
    at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(
    at org.apache.hadoop.ipc.Client$Connection.access$2800(
    at org.apache.hadoop.ipc.Client.getConnection(

I could solve this issue by,
Replacing host name mapping to permanent IP as given below:      master


  1. Thanks for blog. At least some one has faced this issue and solved it !!
    I am facing same problem ....Some time whole job get executed successfully and sometime only maps that are running on AM gets successfully completed but rest maps fails with above errors.
    I had tried many thing and concluded that failed maps try to connect to with AM..on local machine with localhost as machine name.

    For above solution that you have given ,i have some confusion..can you explain it in detail ?
    i have following hosts file in each slaves.each slave has hostname as in seen in maping. localhost slave1 slave2
    ... slaveN

    is above mapping is correct or anything else needed ?


  2. Hi Jagdish,

    I encountered this issue sometime back. As, I remember I setup Hadoop cluster in Vagrant environment. There, in Vagrantfile configuration, I have given the host name using statement below.

    master.vm.hostname = ""

    Then, during Vagrant startup, it will add the following entry to etc/hosts file. master

    I replaced that with the following entry: master

    Also, in master node host file I have given following entry as well.

    This seems to be failure in communication between nodes in Hadoop cluster. You can check the logs for each failed application to see which tasks are failing and in which nodes.

    Did you add the host entry for master node in slaves?