Git Product home page Git Product logo

Comments (9)

beltran avatar beltran commented on August 30, 2024

Hello, you'd have to use ConnectZookeeper, so something like gohive.ConnectZookeeper("devnode2:2181,devnode1:2181,devnode3:2181", "KERBEROS", configuration)

from gohive.

zhijian-pro avatar zhijian-pro commented on August 30, 2024

I noticed this function not in last release version . this is a master version function , Can I use this feature in prod env?

from gohive.

zhijian-pro avatar zhijian-pro commented on August 30, 2024

don't use zk
if beeline command is
beeline -u "jdbc:hive2://devnode1:10000,devnode2:10000/;principal=hive/[email protected]"

How can I rewrite this code in this case,can I write all hosts direct ?
gohive.Connect("hs2.example.com", 10000, "KERBEROS", configuration)
thanks !

from gohive.

beltran avatar beltran commented on August 30, 2024

Hello, I've created a new release with this change. I don't think beeline -u "jdbc:hive2://devnode1:10000,devnode2:10000/;principal=hive/[email protected]" would work but I may be wrong. I thought only one host can specified there, so it would be beeline -u "jdbc:hive2://devnode1:10000;principal=hive/[email protected]", in which case you should be able to connect as you say: gohive.Connect("devnode1", 10000, "KERBEROS", configuration), provided you have done kinit before. There's some more information here.

from gohive.

zhijian-pro avatar zhijian-pro commented on August 30, 2024

First of all thank you for your patient answers, I already know how to code with gohive.
but beeline -u "jdbc:hive2://devnode1:10000,devnode2:10000/;principal=hive/[email protected]" it does work.
when devnode1 hiveserver2 status is ok ,all connection foreword to devnode1, on the other hand,all connection foreword to devnode2.
this is bad ha method then zk. but I test in CDH ,it dose work. And I think it can work in other big data platform.
Thanks again for the answer.

from gohive.

beltran avatar beltran commented on August 30, 2024

Hello. I wasn't aware of that, looks like it's not the case with hive open source at least at the moment. When I try it I get Error: Bad URL format. Hostname not found in authority part of the url: hs2.example.com:10000,hs2.example.com:10000. Are you missing a '/' after the hostname ? (state=,code=0). I guess the feature will be available at some point, I'll add it to the driver when this happens.

from gohive.

zhijian-pro avatar zhijian-pro commented on August 30, 2024

Hello. I wasn't aware of that, looks like it's not the case with hive open source at least at the moment. When I try it I get Error: Bad URL format. Hostname not found in authority part of the url: hs2.example.com:10000,hs2.example.com:10000. Are you missing a '/' after the hostname ? (state=,code=0). I guess the feature will be available at some point, I'll add it to the driver when this happens.

jdbc:hive2://devnode1:10000,devnode2:10000/
Are you missing a '/' ?
please try add '/' ?
These is not reason for doesn't work

from gohive.

beltran avatar beltran commented on August 30, 2024

Yeah it has '/' at the end (this is from todays master):

[hdfs@hs2 /]$ beeline -u "jdbc:hive2://hs2.example.com:10000,hs2.example.com:10000/;"
20/04/28 02:06:04,828 DEBUG VersionInfo: version: 3.1.3
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/hive/lib/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://hs2.example.com:10000,hs2.example.com:10000/;
Error: Bad URL format. Hostname not found  in authority part of the url: hs2.example.com:10000,hs2.example.com:10000. Are you missing a '/' after the hostname ? (state=,code=0)
[hdfs@hs2 /]$ 
[hdfs@hs2 /]$ beeline -u "jdbc:hive2://hs2.example.com:10000/;"
20/04/28 02:07:18,705 DEBUG VersionInfo: version: 3.1.3
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/hive/lib/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://hs2.example.com:10000/;
Connected to: Apache Hive (version 4.0.0-SNAPSHOT)
Driver: Hive JDBC (version 4.0.0-SNAPSHOT)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 4.0.0-SNAPSHOT by Apache Hive
0: jdbc:hive2://hs2.example.com:10000/> 

I don't think the hive in the cloudera distribution is exactly like the open source one, the open source one may be missing a few patches.

from gohive.

zhijian-pro avatar zhijian-pro commented on August 30, 2024

I don't think the hive in the cloudera distribution is exactly like the open source one, the open source one may be missing a few patches.

Alright ,it's my fault . thanks.

from gohive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.