1

I have work on Hadoop/Hive. I have installed Hadoop 1.1.2 and Hive 0.10.0.When I use Hive as command prompt then it works fine,but when I am using as it JDBC in Eclipse then gives the below error :

Could not establish connection to localhost:10000/default: java.net.ConnectException: Connection refused

frogatto
  • 28,539
  • 11
  • 83
  • 129
Charnjeet Singh
  • 3,056
  • 6
  • 35
  • 65

1 Answers1

4

You can connect to Hive in two modes. Through thrift server and embedded mode. By seeing your url localhost:10000/default, it looks like you are trying to connect to the thrift sever. So please ensure that you are have started the hive thrift server by the following command.

    $ hive --service hiveserver

If you want to connect in embedded mode. you should give the url as

   jdbc:hive://

To use the embedded mode you should add the hive/conf and the jars in hive/lib to your classpath.

It is to be noted that, use of the Thrift server is not thread safe as of now.

nJn
  • 406
  • 1
  • 3
  • 13
  • 1
    @Charnjeet Perhaps the port 10000 is already in use by some other process. Please check that once. – nJn Jul 19 '13 at 08:56
  • Can you please explain a bit more, I mean you said you are using JDBC to connect to hive. If this is so, are you using **HiveMetaStoreClient** or something else. – Mukesh S Jul 17 '13 at 14:37