Support Questions
Find answers, ask questions, and share your expertise

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

Explorer

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

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?

View solution in original post

4 REPLIES 4

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?

Explorer

@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?

New Contributor

new to hadoop tried to access hive from terminal I too get the same execption and the terminal looks like bash-4.2#

Can you help proceed further

Community Manager

@idiot , as this thread was marked 'Solved' in June of 2018 you would have a better chance of receiving a useful response by starting a new thread. This will also provide you with the opportunity to provide details specific to your issue that could aid others in providing a more tailored answer to your question.



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.