Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hadoop failed on socket timeout exception: java.net.NoRouteToHostException

Solved Go to solution
Highlighted

Hadoop failed on socket timeout exception: java.net.NoRouteToHostException

New Contributor

Clients are not able to access the Hadoop cluster.

I have checked pinging to the server. It works fine.

The RPC port is up in the Namenode machine

[root@env40-node1 hadoop]# netstat -tupln | grep 8020
tcp        0      0 192.168.150.95:8020     0.0.0.0:*               LISTEN      32588/java

Client is not able to access the cluster

It throws the below given error while accessing HDFS from the client machine

[root@env7-head-proxy4 ~]# hdfs dfs -ls /
ls: No Route to Host from  env7-head-proxy4/192.168.151.48 to 192.168.150.95:8020 failed on socket timeout exception: java.net.NoRouteToHostException: No route to 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Hadoop failed on socket timeout exception: java.net.NoRouteToHostException

Super Mentor

@Basil Paul

Looks like you might have Enabled firewall on the NameNode host "env40-node1"

Can you please check if the firewall (iptables) is stopped on the NameNode host or not?

# service iptables stop      (CentOS 6)
# systemctl stop firewalld   (CentOS 7)

Once you have confirmed that the firewall (iptables) is not running on NameNode host then from the "" try to connect to NameNode using on port 8020 using netcat or telnet to verify the connectivity. Or the host name resolution.

[root@env7-head-proxy4 ~]# nc -v  192.168.150.95 8020
(OR)
[root@env7-head-proxy4 ~]# telnet 192.168.150.95 8020

.

Also please check if the env7 host is able to resolve the hostname of NameNode or not?

2 REPLIES 2

Re: Hadoop failed on socket timeout exception: java.net.NoRouteToHostException

Super Mentor

@Basil Paul

Looks like you might have Enabled firewall on the NameNode host "env40-node1"

Can you please check if the firewall (iptables) is stopped on the NameNode host or not?

# service iptables stop      (CentOS 6)
# systemctl stop firewalld   (CentOS 7)

Once you have confirmed that the firewall (iptables) is not running on NameNode host then from the "" try to connect to NameNode using on port 8020 using netcat or telnet to verify the connectivity. Or the host name resolution.

[root@env7-head-proxy4 ~]# nc -v  192.168.150.95 8020
(OR)
[root@env7-head-proxy4 ~]# telnet 192.168.150.95 8020

.

Also please check if the env7 host is able to resolve the hostname of NameNode or not?

Re: Hadoop failed on socket timeout exception: java.net.NoRouteToHostException

New Contributor

@Jay Kumar SenSharma Thankyou buddy from the bottom of my heart. The issue got resolved after stopping the firewall. Could you please tell me the the root cause behind the problem. Why did the firewall stop the port number?

Don't have an account?
Coming from Hortonworks? Activate your account here