arsenal
arsenal

Reputation: 24184

Find Port Number and Domain Name to connect to Hive Table

I am new to Hive, MapReduce and Hadoop. I am using Putty to connect to hive table and access records in the tables. So what I did is- I opened Putty and in the host name I typed- vip.host.com and then I click Open. And then I entered my username and password and then few commands to get to Hive sql. Below is the list what I did

$ bash
bash-3.00$ hive
Hive history file=/tmp/unl/hive_job_log_unl_201207010451_1212680168.txt
hive> set mapred.job.queue.name=mdhi-technology;
hive> select * from table LIMIT 1;

So my question is-

I was trying to connect to Hive Tables using Squirrel SQL Client, so in that my Connection URL is- jdbc:hive://vip.host.com:10000/default. So whenever I try to connect with these attributes, I always get Hive: Could not establish connection to vip.host.com:10000/default: java.net.ConnectException: Connection timed out: connect.

It might be possible I am using wrong port number or domain name here. Is there any way from the command prompt I can find out these two things, like what Domain Name and Port Number(where Hive server is running) should I use to connect to Hive table from Squirrel SQL Client.

As I know host and port are determined by where the hive server is running

Upvotes: 2

Views: 26363

Answers (3)

BigDataGeek
BigDataGeek

Reputation: 144

If you are able to login to hiveCLI, you just have to execute below property.

hive> set hive.server2.thrift.port;

It should give you the port number where hiveserver2 is running. It looks something like below.

hive.server2.thrift.port=10014

Upvotes: 5

ForeverLearner
ForeverLearner

Reputation: 2113

Posting this after quite some time. I did not get lsof command. So used this workaround.

If you have hive access:

hive> set hive.metastore.uris;

hive.metastore.uris=thrift://sandbox.hortonworks.com:9083

Upvotes: 5

Nahuel Fouilleul
Nahuel Fouilleul

Reputation: 19335

If you know the host and can logon: try

/usr/sbin/lsof -i

Upvotes: 2

Related Questions