My Map/Reduce Tasks fail because all the tasks fails trying to connect to localhost instead of the zookeeper ip address ..
In my hadoop job, i had set the following code --
Configuration conf = new Configuration();
conf.set("hbase.zookeeper.quorum", "10.10.187.170"); //zk ip is 10.10.187.170
conf.set("hbase.zookeeper.property.clientPort","2181");// default zk port
I was stuck with this issue for a very long time..2013-08-24 20:05:36,213 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration) 2013-08-24 20:05:36,213 WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)Turns out, i had to do it for all of my configuration objects.. I had a few more in the map function, reduce function etc.
So, if you stumble upon this error again, check all of your hadoop configuration objects and see if hbase.zookeeper.quorum is set to the proper IP.
Everything will work fine after that.
Cheers.