<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Cannot connect 'Streaming Data Ingest' to secured Hive instance in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140583#M32038</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11172/stevencastelein.html" nodeid="11172"&gt;@Steven Castelein&lt;/A&gt; Hiveserver2 in secure environment by default  Authentication mode uses plain SASL.&lt;/P&gt;&lt;P&gt;You can disable it either by setting in In hive-site.xml:  hive.server2.authentication= 'NOSASL'&lt;/P&gt;&lt;P&gt;Or To Use SASL:  (https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2#SettingUpHiveServer2-Integrity/ConfidentialityProtection)&lt;/P&gt;&lt;P&gt;Integrity/Confidentiality Protection&lt;/P&gt;&lt;P&gt;Integrity protection and confidentiality protection (beyond just the default of authentication) for communication between the Hive JDBC driver and HiveServer2 are enabled (Hive 0.12 onward, see &lt;A href="https://issues.apache.org/jira/browse/HIVE-4911"&gt;HIVE-4911&lt;/A&gt;). You can use the &lt;A href="http://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer"&gt;SASL&lt;/A&gt; &lt;A href="http://docs.oracle.com/javase/7/docs/api/javax/security/sasl/Sasl.html#QOP"&gt;QOP&lt;/A&gt; property to configure this.&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;This is only when Kerberos is used for the HS2 client (JDBC/ODBC application) authentication with HiveServer2.&lt;/LI&gt;&lt;LI&gt;hive.server2.thrift.sasl.qop in &lt;CODE&gt;hive-site.xml&lt;/CODE&gt; has to be set to one of the valid &lt;A href="http://docs.oracle.com/javase/7/docs/api/javax/security/sasl/Sasl.html#QOP"&gt;QOP&lt;/A&gt; values ('auth', 'auth-int' or 'auth-conf').&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can connect via below url&lt;/P&gt;&lt;P&gt;jdbc:hive2://&amp;lt;m/c HS2&amp;gt;:10001/default;principal=&amp;lt;hive princiapl&amp;gt;?transportMode=http;httpPath=cliservice;auth=kerberos;sasl.qop=auth-int  (if auth-int is set)&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2016 16:26:35 GMT</pubDate>
    <dc:creator>dchiguruvad</dc:creator>
    <dc:date>2016-06-16T16:26:35Z</dc:date>
    <item>
      <title>Cannot connect 'Streaming Data Ingest' to secured Hive instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140582#M32037</link>
      <description>&lt;P&gt;I've downloaded the Hortonworks Sandbox 2.4 to develop some tools locally on my machine. One of the first things I want to do is load data into Hive. I've first tried to the regular JDBC connector, which worked but was way to slow. &lt;/P&gt;&lt;P&gt;When doing this I ran across the first interesting issue: the sandbox has authentication enabled and controlled by Ranger. So when I connect using beeline and the URL jdbc:hive2://localhost:10000 I was asked for username and password. However, when connecting from Java, this was not required and could read and insert data. Can someone explain this?&lt;/P&gt;&lt;PRE&gt;public DataSource dataSource() {
	return new SimpleDriverDataSource(new HiveDriver(), "jdbc:hive2://localhost:10000/variantdatabase");
}&lt;/PRE&gt;&lt;P&gt;Then I learned about the streaming API which seemed a better alternative for loading lot's of data into Hive ( regular load file doesn't work for me ). So I started following this article: &lt;A href="https://cwiki.apache.org/confluence/display/Hive/Streaming+Data+Ingest#StreamingDataIngest-StreamingMutationAPI" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/Streaming+Data+Ingest#StreamingDataIngest-StreamingMutationAPI&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;Relevant code:&lt;/P&gt;&lt;PRE&gt;HiveEndPoint hiveEP = new HiveEndPoint("hive2://localhost:10000", "variantdatabase", "variant", null);this.connection = hiveEP.newConnection(true);&lt;/PRE&gt;&lt;P&gt;However, connecting takes ages, and after a while I get the following message in the client:&lt;/P&gt;&lt;PRE&gt;17:03:47.742 [main] INFO  org.apache.hive.jdbc.HiveConnection - Will try to open client transport with JDBC Uri: jdbc:hive2://localhost:10000/variantdatabase
17:03:48.518 [main] DEBUG o.a.h.h.streaming.HiveEndPoint - Overriding HiveConf setting : hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
17:03:48.519 [main] DEBUG o.a.h.h.streaming.HiveEndPoint - Overriding HiveConf setting : hive.support.concurrency = true
17:03:48.519 [main] DEBUG o.a.h.h.streaming.HiveEndPoint - Overriding HiveConf setting : hive.metastore.execute.setugi = true
17:03:48.519 [main] DEBUG o.a.h.h.streaming.HiveEndPoint - Overriding HiveConf setting : hive.execution.engine = mr
17:03:48.706 [main] WARN  o.a.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
17:03:48.735 [main] INFO  hive.metastore - Trying to connect to metastore with URI hive2://localhost:10000
17:13:48.814 [main] WARN  hive.metastore - set_ugi() not successful, Likely cause: new client talking to old server. Continuing without it.
org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129) ~[hive-exec-1.2.1.jar:1.2.1]&lt;/PRE&gt;&lt;P&gt;When I look in the server log it says something about SASL, but I don't understand why, because JDBC didn't need it? And where I can define any username/password?&lt;/P&gt;&lt;PRE&gt;Caused by: org.apache.thrift.transport.TTransportException: Invalid status -128
        at org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:232)
        at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:184)
        at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:25:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140582#M32037</guid>
      <dc:creator>Steven_Castelei</dc:creator>
      <dc:date>2022-09-16T10:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot connect 'Streaming Data Ingest' to secured Hive instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140583#M32038</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11172/stevencastelein.html" nodeid="11172"&gt;@Steven Castelein&lt;/A&gt; Hiveserver2 in secure environment by default  Authentication mode uses plain SASL.&lt;/P&gt;&lt;P&gt;You can disable it either by setting in In hive-site.xml:  hive.server2.authentication= 'NOSASL'&lt;/P&gt;&lt;P&gt;Or To Use SASL:  (https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2#SettingUpHiveServer2-Integrity/ConfidentialityProtection)&lt;/P&gt;&lt;P&gt;Integrity/Confidentiality Protection&lt;/P&gt;&lt;P&gt;Integrity protection and confidentiality protection (beyond just the default of authentication) for communication between the Hive JDBC driver and HiveServer2 are enabled (Hive 0.12 onward, see &lt;A href="https://issues.apache.org/jira/browse/HIVE-4911"&gt;HIVE-4911&lt;/A&gt;). You can use the &lt;A href="http://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer"&gt;SASL&lt;/A&gt; &lt;A href="http://docs.oracle.com/javase/7/docs/api/javax/security/sasl/Sasl.html#QOP"&gt;QOP&lt;/A&gt; property to configure this.&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;This is only when Kerberos is used for the HS2 client (JDBC/ODBC application) authentication with HiveServer2.&lt;/LI&gt;&lt;LI&gt;hive.server2.thrift.sasl.qop in &lt;CODE&gt;hive-site.xml&lt;/CODE&gt; has to be set to one of the valid &lt;A href="http://docs.oracle.com/javase/7/docs/api/javax/security/sasl/Sasl.html#QOP"&gt;QOP&lt;/A&gt; values ('auth', 'auth-int' or 'auth-conf').&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can connect via below url&lt;/P&gt;&lt;P&gt;jdbc:hive2://&amp;lt;m/c HS2&amp;gt;:10001/default;principal=&amp;lt;hive princiapl&amp;gt;?transportMode=http;httpPath=cliservice;auth=kerberos;sasl.qop=auth-int  (if auth-int is set)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 16:26:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140583#M32038</guid>
      <dc:creator>dchiguruvad</dc:creator>
      <dc:date>2016-06-16T16:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot connect 'Streaming Data Ingest' to secured Hive instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140584#M32039</link>
      <description>&lt;P&gt;Thanks for your response but I still can't get it to work. I tried setting the NOSASL value for the hive.server2.authentication property. Now the following happens:&lt;/P&gt;&lt;P&gt;* Connecting via beeline fails, I'm getting asked for a username / password, but the one I used successfully before now doesn't work.&lt;/P&gt;&lt;P&gt;* I cannot  open a JDBC connection anymore:&lt;/P&gt;&lt;PRE&gt;Caused by: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000/variantdatabase: null
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:231)Caused by: org.apache.thrift.transport.TTransportException
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)&lt;/PRE&gt;&lt;P&gt;Server log:&lt;/P&gt;&lt;PRE&gt;2016-06-16 13:12:39,018 ERROR [HiveServer2-Handler-Pool: Thread-32]: server.TThreadPoolServer (TThreadPoolServer.java:run(294)) - Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Missing version in readMessageBegin, old client?
        at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:228)&lt;/PRE&gt;&lt;P&gt;Why is everything so counter-intuitive? If I have authentication enabled, JDBC works without specifying any credentials, if disabled it doesn't? Why can't I just specify username/password for a connection from the streaming digest code using the HiveEndPoint constructor or newConnection() method.  Also for beeline, I have authentication disabled, but still get asked for a username / password?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 20:23:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140584#M32039</guid>
      <dc:creator>Steven_Castelei</dc:creator>
      <dc:date>2016-06-16T20:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot connect 'Streaming Data Ingest' to secured Hive instance</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140585#M32040</link>
      <description>&lt;P&gt;Ok, so the solution is quite simple here, I tried to connect to the Hive2Server that was running on port 10000 whereas I actually should have connected to the metastore which is running on port 9083 .&lt;/P&gt;&lt;P&gt;hive.server2.authentication is set to NONE and not to NOSASL. &lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 19:31:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Cannot-connect-Streaming-Data-Ingest-to-secured-Hive/m-p/140585#M32040</guid>
      <dc:creator>Steven_Castelei</dc:creator>
      <dc:date>2016-06-17T19:31:15Z</dc:date>
    </item>
  </channel>
</rss>

