Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.net.ConnectException: Connection refused error when running Hive

Tags:

hadoop

hive

I'm trying work through a hive tutorial in which I enter the following:

load data local inpath '/usr/local/Cellar/hive/0.11.0/libexec/examples/files/kv1.txt' overwrite into table pokes;

Thits results in the following error:

FAILED: RuntimeException java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused

I see that there are some replies on SA having to do with configuring my ip address and local host, but I'm not familiar with the concepts in the answers. I'd appreciate anything you can tell me about the fundamentals of what causes this kind of answer and how to fix it. Thanks!

like image 540
ouonomos Avatar asked Nov 24 '13 05:11

ouonomos


2 Answers

This is because hive is not able to contact your namenode

Check if your hadoop services has started properly.

Run the command jps to see what all services are running.

like image 106
vishnu viswanath Avatar answered Sep 30 '22 19:09

vishnu viswanath


The reason why you get this error is that Hive needs hadoop as its base. So, you need to start Hadoop first.

Here are some steps.

Step1: download hadoop and unzip it

Step2: cd #your_hadoop_path

Step3: ./bin/hadoop namenode -format

Step4: ./sbin/start-all.sh

And then, go back to #your_hive_path and start hive again

like image 38
Haimei Avatar answered Sep 30 '22 18:09

Haimei