Support Questions
Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

NiFi PutHiveStreaming connection issue when connecting to Kerberized HDP

Rising Star

Hi guys,

We cannot connect to Kerberized Hive (on HDP 2.5 and Hive 2.6) from NiFi instance (NiFi 1.2.0); both PutHiveQL and PutHiveStreaming are erroring.

Using the same properties (principal and keytab values) and the same XML files (hive-site.xml, core-site.xml, hdfs-site.xml, hbase-site.xml), NiFi can read and write from HDFS and HBase, so not sure why the problem only with Hive. Also, from the same NiFi server, using a simple java program, the connection to Hive works, it's only through NiFi that it fails.

Did a klist and it shows a valid ticket; also, manually ran kinit with principal and keytab and restarted NiFi, but still same error.

In, both nifi.kerberos.service.principal and nifi.kerberos.service.keytab.location are commented out, not sure if they should be uncommented or not, because those values are present in the processor properties; also, this entry is present in the properties file - nifi.kerberos.krb5.file=/etc/krb5.conf;

Below is the error trace from NiFi log for PutHiveStreaming:

2017-10-23 11:32:23,841 INFO [put-hive-streaming-0] hive.metastore Trying to connect to metastore with URI thrift://
2017-10-23 11:32:23,856 INFO [put-hive-streaming-0] hive.metastore Connected to metastore.
2017-10-23 11:32:23,885 INFO [Timer-Driven Process Thread-7] hive.metastore Trying to connect to metastore with URI thrift://
2017-10-23 11:32:23,895 INFO [Timer-Driven Process Thread-7] hive.metastore Connected to metastore.
2017-10-23 11:32:24,730 WARN [put-hive-streaming-0] o.a.h.h.m.RetryingMetaStoreClient MetaStoreClient lost connection. Attempting to reconnect.
org.apache.thrift.TApplicationException: Internal error processing open_txns
	at org.apache.thrift.TServiceClient.receiveBase(
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_open_txns(
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.open_txns(
	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.openTxns(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(
	at com.sun.proxy.$Proxy231.openTxns(Unknown Source)
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$TransactionBatchImpl$
	at Method)
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$TransactionBatchImpl.openTxnImpl(
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$TransactionBatchImpl.<init>(
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$TransactionBatchImpl.<init>(
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl.fetchTransactionBatchImpl(
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl.access$500(
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl$
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl$
	at Method)
	at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl.fetchTransactionBatch(
	at org.apache.nifi.util.hive.HiveWriter.lambda$nextTxnBatch$2(
	at org.apache.nifi.util.hive.HiveWriter.lambda$null$3(
	at Method)
	at org.apache.nifi.util.hive.HiveWriter.lambda$callWithTimeout$4(
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$

Thanks in advance.


Super Guru

If you are using Apache NiFi, the Hive processors are not compatible with HDP 2.5, because the Hive version on HDP is "newer" than the released versions of Apache Hive 1.2.x (the latter of which is used by Apache NiFi). In order to use the Hive processors with HDP, you should use the NiFi that comes with Hortonworks DataFlow (HDF). Version 3.0.x is based on NiFi 1.2.0 but is built with HDP Hive JARs and is compatible with HDP 2.5+.

Rising Star

@Matt BurgessI tried testing PutHiveStreaming on HDF 3.0 (with HDP 2.5) and I'm still getting an error