Monday, October 15, 2012

Hive Thrift Server

Hive provide a service that can be called as hive server or thrift server which helps us to access hive using different languages like c++, Java, Ruby, Python and many others remotely like how we use JDBC or ODBC connectors.

By default we use Command line to access hive, but to use hive programmatically we need such facility as a server that runs on an address and a port no so that it can be used in programming language efficiently and easily.

 

Starting Thrift Server :

 

bin/hive  - -service  hiveserver  &      -----> this will start thrift server and will give terminal to be used

or

bin/hive - - service hiveserver          -------> this need to keep the terminal open, if terminal is closed server will be killed (Look for & operator in linux)

 

 

after starting this you can verify whether hive thrift server is running or not, by using following command

netstat –nl | grep 10000

 

if it shows something like :

 

tcp 0 0 :::10000 :::* Listen

 

that means your thrift server is running successfully. by default thrift server runs on port no 10000 we and also make it to run on different port no. as follows

build/dist/bin/hive --service hiveserver --help
usage HIVE_PORT=xxxx ./hive --service hiveserver
HIVE_PORT : Specify the server port

 


Limitation with Thrift server : HiveServer can not handle concurrent requests from more than one client. This is actually a limitation imposed by the Thrift interface that HiveServer exports, and can't be resolved by modifying the HiveServer code.


for using hive with jdbc and java refer –>  Infinity



Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...