NiFi 处理器无法连接到 Zookeeper

问题描述

我正在将 Apache NiFi 1.9.2(安全集群)与 HDP 3.1.4 集成。 HDP 包含带有 SASL 身份验证 (Kerberos) 的 Zookeeper 3.4.6。 NiFi 节点成功连接到此 Zookeeper,同步流量并记录心跳。

与此同时,使用 Zookeeper 的 NiFi 处理器无法连接。 GenerateTableFetch 抛出:

org.apache.commons.dbcp.sqlnestedException: Cannot create PoolableConnectionFactory (Could not open client transport for any of the Server URI's in ZooKeeper: Unable to read HiveServer2 uri from ZooKeeper)

ListHDFS 尝试将其状态写入 ZooKeeper 失败:

o.apache.nifi.processors.hadoop.ListHDFS ListHDFS  Failed to retrieve timestamp of last listing from the State Manager. Will not perform listing until this is accomplished.

但是 GetHDFS(不与 zk 通信)工作正常。 启用 HiveConnector 可以正常工作。

感谢您之前的任何想法和支持

解决方法

首先,我错过了 state-management.xml 中的 zk 连接字符串(感谢 @BenYaakobi 的注意)。

其次,Hive 处理器与 nifi-hive3-nar library 中的 Hive3ConnectionPool 一起工作。库包含 Hive3* 处理器,但 Hive1*(例如 SelectHiveQL、GenerateTableFetch)处理器也可与 Hive3 连接器配合使用。