Connection refused error while running Hive in Hadoop

When Hive Installation in a single node cluster setup on Hadoop ecosystem sometimes showing below like this:

Connection refused error in Hive

Exception in thread  “main”  java.lang.RuntimeException: call From your domain/ to localhost:8020 failed on connection exception: refused:

For more details see:

at org.apache.hadoop.hive.ql.session.SesseionState.start(
at org.apache.hadoop.hive.cli.CliDriver.main.(
at sum.reflect.NativeMethodAccessorImpl.invoke(Native Method)

Caused by: : Call From  slthupili/ to localhost:8020 failed on connection exception: Connection refused;

at sun.reflect.NativeConstructorAccessorImpl.newInstance0
(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
at java.lang.reflect.Constructor.newInstance(

Caused by : java.netConnectException: Connection refused

at Method)





First, stop all services in Hadoop using below command:


This command used for all services like NameNode, DataNode, SecondaryNode, YARN, etc.

Second step back up the data then will use below command

$ hadoop namenode -format

Above command removes unnecessary data then enter hive command

$ hive


Leave a Reply

Your email address will not be published. Required fields are marked *