hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Ramadorai <jramado...@tripadvisor.com>
Subject Making Thrift work with Hive in client-server mode
Date Thu, 03 Feb 2011 14:22:14 GMT
Can someone explain how the Thriftserver finds the Hive metastore?

I am running with all non-default values and need to know how to connect to Thrift so it finds
Hive with the right metastore.

I am running Derby in server mode on a non-default port. And my metastore name is non-default.
And I want to run my Thrift server on a non-default port.

My hive-site looks like this:
<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:derby://myhost:2222/MYmetastore_db;create=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>org.apache.derby.jdbc.ClientDriver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>
--------
I start derby up as follows :
cd $DERBY_HOME/data
nohup $DERBY_HOME/bin/startNetworkServer -h 0.0.0.0 -p 3333 &
---------
I am able to connect from the Hive CLI just fine and able to create, drop, select from tables
in the right metastore.
--------
Now I start my Thrift server as follows:
HIVE_PORT=11000
export HIVE_PORT
nohup hive  --service hiveserver &

Thrift server starts up fine and attaches to port 11000
------------
Now I try to run the Hive server test: 
ant test -Dtestcase=TestJdbcDriver -Dstandalone=true
...and of course it says Tests Failed, with no further specific detail.

The Test java program (http://wiki.apache.org/hadoop/Hive/HiveClient)  tries to connect as:
DriverManager.getConnection("jdbc:hive://localhost:10000/default", "", "")
My question is besides changing it to 
DriverManager.getConnection("jdbc:hive://myhost:11000/default", "", "")
what else do I need to do?
What does the "default" in the connect string signify? Should that be my metastore name? There
is also a DATABASE in Hive called "default", so I am not so sure that I should change this.

Bottom line how is the Thrift server supposed to find the metatore, and how should I connect
to the Thrift server from a jdbc client.
Thanks
JayR




Mime
View raw message