hadoop - org.apache.thrift.transport.TTransportException: Cannot open without port? -


there

i quite new hive, , java app accesses hive kerberos authentication, below:

try         {             system.setproperty("java.security.krb5.conf", "/hamanage/krb5.conf");             stringbuilder sbuilder = new stringbuilder();             sbuilder.append("jdbc:hive2://ha-cluster/default");             sbuilder.append(";zk.quorum=").append("x.x.x.x,x.x.x.x");//ip list             sbuilder.append(";zk.port=").append("24002");             if (issecurever) {                 sbuilder.append(";user.principal=")                         .append("hadoop@hadoop.com")                         .append(";user.keytab=")                         .append("/home/hdclient/gyj/user.keytab")                         .append(";sasl.qop=auth-conf;auth=kerberos;principal=hive/" +                                 "hadoop.hadoop.com@hadoop.com;zk.principal=zookeeper/hadoop.hadoop.com");             }             url = sbuilder.tostring();             logger.info(url);             class.forname("org.apache.hive.jdbc.hivedriver");             conntohive = drivermanager.getconnection(url,"","");         } catch (exception e)         {             logger.error("error occurs",e);         } 

but exception happens, shown below:

caused by: org.apache.thrift.transport.ttransportexception: cannot open without port.      @ org.apache.thrift.transport.tsocket.open(tsocket.java:172) ~[hive-exec-0.14.0.jar:0.14.0]      @ org.apache.thrift.transport.tsasltransport.open(tsasltransport.java:248) ~[hive-exec-0.14.0.jar:0.14.0]      @ org.apache.thrift.transport.tsaslclienttransport.open(tsaslclienttransport.java:37) ~[hive-exec-0.14.0.jar:0.14.0]      @ org.apache.hadoop.hive.thrift.client.tugiassumingtransport$1.run(tugiassumingtransport.java:52) ~[hive-exec-0.14.0.jar:0.14.0]      @ org.apache.hadoop.hive.thrift.client.tugiassumingtransport$1.run(tugiassumingtransport.java:49) ~[hive-exec-0.14.0.jar:0.14.0]      @ java.security.accesscontroller.doprivileged(native method) ~[na:1.7.0_45]      @ javax.security.auth.subject.doas(subject.java:415) ~[na:1.7.0_45]      @ org.apache.hadoop.security.usergroupinformation.doas(usergroupinformation.java:1656) ~[hadoop-common-2.6.4.jar:na]      @ org.apache.hadoop.hive.thrift.client.tugiassumingtransport.open(tugiassumingtransport.java:49) ~[hive-exec-0.14.0.jar:0.14.0]      @ org.apache.hive.jdbc.hiveconnection.opentransport(hiveconnection.java:190) ~[hive-jdbc-1.1.0.jar:1.1.0]      ... 6 common frames omitted  

any effort appreciated.

while have zookeeper port specified query string parameter (needed kerberos auth) need have port hive after hostname part of url. normal port used hive 10000, url might start this:

sbuilder.append("jdbc:hive2://ha-cluster:10000/default"); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -