Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Unable to connect hive via ODBC zookeeper

avatar
New Contributor

Hi hortonworks Community,

I am facing some issues while connecting hive via ODBC using zookeeper.

HDP version: 2.6

Zookeeper:3.4.6

38539-zookeeper.png

38538-odbc.png

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Mohammed Ayaz

HDP 2.3

Ambari 2.1.2

Non kerberized.

Installed HortonworksHiveODBC32 and HortonworksHiveODBC64 bit

Laptop C:\Windows\System32\drivers\etc\hosts entry

# localhost name resolution is handled within DNS itself. 
#127.0.0.1       localhost 
#::1             localhost 
192.168.0.80   gulu.uganda.com   gulu 
192.168.0.157  bombo.uganda.com  bombo 
192.168.0.213  sandbox.hortonworks.com   sandbox 

Logged to my I node cluster using putty

[hive@bombo ~]$ hive WARNING: Use "yarn jar" to launch YARN applications. 
Logging initialized using configuration in file:/etc/hive/2.3.6.0-3796/0/hive-log4j.properties 
hive> show databases; 
OK 
default Time taken: 4.796 seconds, Fetched: 1 row(s) 
hive> SET hive.cli.print.header=true;
hive> create database amin; 
OK 
Time taken: 1.79 seconds 
hive> use amin; 
OK 
Time taken: 0.355 seconds 

Created a table

hive>CREATE TABLE amin.orders_hive
(
  Order_ID                      string
, Customer_ID                   int
, Store_ID                      int
-- , Order_Datetime_Orig           timestamp
, Order_Datetime                timestamp
, Ship_Completion_Datetime      timestamp
, Return_Datetime               timestamp
, Refund_Datetime               timestamp
, Payment_Method_Code           string
)
  -- PARTITIONED BY (Order_Datetime timestamp)
  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
  STORED AS TEXTFILE
  LOCATION '/apps/hive/warehouse/';

I choose 2 types of connection with and without zookeeper and my connection was successful. I then created a third connection with my user/password and that too was successful using option.

See attached screenshots

Hope that helps


ayaz02hdp23.jpgayaz-zookeeper-hdp23.jpgnewuserhdp23.jpg

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Mohammed Ayaz

Can you paste here your hosts entry ?

avatar
New Contributor

@Geoffrey Shelton Okot

10.127.36.221 ambari.hdp.local hdpc

10.127.36.214 hadoopmaster.hdp.local hdpm

10.127.36.217 hadoopslave1.hdp.local hdps1

10.127.36.218 hadoopslave2.hdp.local hdps2

avatar
Master Mentor

@Mohammed Ayaz

HDP 2.3

Ambari 2.1.2

Non kerberized.

Installed HortonworksHiveODBC32 and HortonworksHiveODBC64 bit

Laptop C:\Windows\System32\drivers\etc\hosts entry

# localhost name resolution is handled within DNS itself. 
#127.0.0.1       localhost 
#::1             localhost 
192.168.0.80   gulu.uganda.com   gulu 
192.168.0.157  bombo.uganda.com  bombo 
192.168.0.213  sandbox.hortonworks.com   sandbox 

Logged to my I node cluster using putty

[hive@bombo ~]$ hive WARNING: Use "yarn jar" to launch YARN applications. 
Logging initialized using configuration in file:/etc/hive/2.3.6.0-3796/0/hive-log4j.properties 
hive> show databases; 
OK 
default Time taken: 4.796 seconds, Fetched: 1 row(s) 
hive> SET hive.cli.print.header=true;
hive> create database amin; 
OK 
Time taken: 1.79 seconds 
hive> use amin; 
OK 
Time taken: 0.355 seconds 

Created a table

hive>CREATE TABLE amin.orders_hive
(
  Order_ID                      string
, Customer_ID                   int
, Store_ID                      int
-- , Order_Datetime_Orig           timestamp
, Order_Datetime                timestamp
, Ship_Completion_Datetime      timestamp
, Return_Datetime               timestamp
, Refund_Datetime               timestamp
, Payment_Method_Code           string
)
  -- PARTITIONED BY (Order_Datetime timestamp)
  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
  STORED AS TEXTFILE
  LOCATION '/apps/hive/warehouse/';

I choose 2 types of connection with and without zookeeper and my connection was successful. I then created a third connection with my user/password and that too was successful using option.

See attached screenshots

Hope that helps


ayaz02hdp23.jpgayaz-zookeeper-hdp23.jpgnewuserhdp23.jpg

avatar
New Contributor

Thank you @Geoffrey Shelton Okot,

I have added hosts in client machine, it works like charm.