Nifi java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations [英] Nifi java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations

查看:39
本文介绍了Nifi java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在点击此链接设置 Nifi putHDFS 以写入 Azure 数据湖.从 NiFi 数据流连接到 Azure Data Lake

I am following this link to set up Nifi putHDFS to write to Azure Data Lake.Connecting to Azure Data Lake from a NiFi dataflow

Nifi 在 HDF 3.1 VM 中,Nifi 版本为 1.5.

The Nifi is within HDF 3.1 VM and the Nifi version is 1.5.

我们从一个HD Insight(v 3.6,支持hadoop 2.7)头节点得到了上面链接中提到的jar文件,这些jar文件是:

We got the jar files mentioned in the above link, from a HD Insight(v 3.6, which supports hadoop 2.7) head node, these jars are:

adls2-oauth2-token-provider-1.0.jar

azure-data-lake-store-sdk-2.1.4.jar

hadoop-azure-datalake.jar

jackson-core-2.2.3.jar

okhttp-2.4.0.jar

okio-1.4.0.jar

然后将它们复制到 HDF 集群 Nifi 主机的文件夹/usr/lib/hdinsight-datalake(我们集群中只有 1 个主机).putHDFS 配置(图片)如附件所示(与上面的链接完全相同)putHDFS 属性.

And they are copied to the folder /usr/lib/hdinsight-datalake of the HDF cluster Nifi host(we only have 1 host in the cluster). And the putHDFS config(picture) is as attached(exactly as the link above)putHDFS attributes.

但是在 nifi 日志中我们得到了这个:

But in the nifi log we are getting this:

Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations()V at org.apache.hadoop.fs.adl.AdlConfKeys.addDeprecatedKeys(AdlConfKeys.java:112) at org.apache.hadoop.fs.adl.AdlFileSystem.(AdlFileSystem.java:92) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor$ExtendedConfiguration.getClassByNameOrNull(AbstractHadoopProcessor.java:490) at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2099) at org.apache.hadoop.conf.Configuration.getClass(Configuration).java:2193) 在 org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2654) 在 org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2667) 在 org.apache.hadoop.fs.FileSystem.get(FileSystem.java:370) 在 org.apache.hadoop.fs.FileSystem.get(FileSystem.java:172) 在 org.apache.nifi.processors.hadoop.AbstractHadoopProcessor$1.run(AbstractHadoopProcessor.java:322) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor$1.run(AbstractHadoopProcessor.java:319) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) 在 org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698) 在 org.apache.nifi.processors.hadoop.AbstractHadoopProcessor.getFileSystemAsUser(AbstractHadoopProcessor.java:319) 在 org.apache.nifi.processors.hadoop.AbstractHadoopProcessor.resetHDFSResources(AbstractHadoopProcessor.java:281) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor.abstractOnScheduled(AbstractHadoopProcessor.java:205) ...省略了16个常见框架

Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations()V at org.apache.hadoop.fs.adl.AdlConfKeys.addDeprecatedKeys(AdlConfKeys.java:112) at org.apache.hadoop.fs.adl.AdlFileSystem.(AdlFileSystem.java:92) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor$ExtendedConfiguration.getClassByNameOrNull(AbstractHadoopProcessor.java:490) at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2099) at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2193) at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2654) at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2667) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:370) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:172) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor$1.run(AbstractHadoopProcessor.java:322) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor$1.run(AbstractHadoopProcessor.java:319) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor.getFileSystemAsUser(AbstractHadoopProcessor.java:319) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor.resetHDFSResources(AbstractHadoopProcessor.java:281) at org.apache.nifi.processors.hadoop.AbstractHadoopProcessor.abstractOnScheduled(AbstractHadoopProcessor.java:205) ... 16 common frames omitted

AdlConfKeys 类来自上面的 hadoop-azure-datalake.jar 文件.从上面的异常来看,在我看来,这个 AdlConfKeys 正在加载一个旧版本的 org.apache.hadoop.conf.Configuration 类,它没有 reloadExistingConfigurations 方法.但是,我们无法找出从何处加载这个较旧的类.这个 HDF 3.1 在多个位置有 hadoop-common-XXXX.jar,所有在 2.7 版上的东西都有包含方法 reloadExistingConfigurations 的 org.apache.hadoop.conf.Configuration,只有在 2.3 版上没有这个方法.(我把 2.7 和 2.3 jar 都反编译了看看)

The AdlConfKeys class is from the hadoop-azure-datalake.jar file above. From the above exception, it seems to me this AdlConfKeys is loading an older version of the org.apache.hadoop.conf.Configuration class, which does not have the reloadExistingConfigurations method. However we cannot find out from where this older class gets loaded. This HDF 3.1 has the hadoop-common-XXXX.jar in multiple locations, all those on version 2.7 something has the org.apache.hadoop.conf.Configuration containing the method reloadExistingConfigurations, only those on version 2.3 don't have this method.(I decompiled both 2.7 and 2.3 jars to find out)

[root@NifiHost /]# find . -name *hadoop-common*

(输出比下面多很多,但是为了显示目的我删除了一些,其中大部分在 2.7 上,其中只有 2 个在 2.3 版上):

(the output is a lot more than below, however I removed some for display purpose, most of them are on 2.7, only 2 of them are on version 2.3):

./var/lib/nifi/work/nar/extensions/nifi-hadoop-libraries-nar-1.5.0.3.1.0.0-564.nar-unpacked/META-INF/bundled-dependencies/hadoop-common-2.7.3.jar

./var/lib/ambari-agent/cred/lib/hadoop-common-2.7.3.jar

./var/lib/ambari-server/resources.backup/views/work/WORKFLOW_MANAGER{1.0.0}/WEB-INF/lib/hadoop-common-2.7.3.2.6.2.0-205.jar

./var/lib/ambari-server/resources.backup/views/work/HUETOAMBARI_MIGRATION{1.0.0}/WEB-INF/lib/hadoop-common-2.3.0.jar

./var/lib/ambari-server/resources/views/work/HUETOAMBARI_MIGRATION{1.0.0}/WEB-INF/lib/hadoop-common-2.3.0.jar

./var/lib/ambari-server/resources/views/work/HIVE{1.5.0}/WEB-INF/lib/hadoop-common-2.7.3.2.6.4.0-91.jar

./var/lib/ambari-server/resources/views/work/CAPACITY-SCHEDULER{1.0.0}/WEB-INF/lib/hadoop-common-2.7.3.2.6.4.0-91.jar

./var/lib/ambari-server/resources/views/work/TEZ{0.7.0.2.6.2.0-205}/WEB-INF/lib/hadoop-common-2.7.3.2.6.2.0-205.jar

./usr/lib/ambari-server/hadoop-common-2.7.2.jar

./usr/hdf/3.1.0.0-564/nifi/ext/ranger/install/lib/hadoop-common-2.7.3.jar

./usr/hdf/3.0.2.0-76/nifi/ext/ranger/install/lib/hadoop-common-2.7.3.jar

所以我真的不知道 Nifi 是如何设法找到一个 hadoop-common jar 文件或其他包含 Configuration 类的东西没有方法 reloadExistingConfigurations().我们也没有将任何自定义的 Nar 文件部署到 Nifi,所有内容都几乎是 Nifi 上 HDF 3.1 的默认设置.

So I really don't know how Nifi managed to find a hadoop-common jar file or something else containing the Configuration class does not have the method reloadExistingConfigurations(). We do not have any customized Nar files deployed to Nifi either, everything is pretty much default from whatever HDF 3.1 has on Nifi.

请指教.我已经花了一整天的时间,但无法解决这个问题.感谢您的帮助.

Please advise. I've been spending a whole day on this but can't fix the issue. Appreciate your help.

推荐答案

我认为您使用的 Azure JAR 需要比 NiFi 使用的 2.7.3 版本更新的 hadoop-common 版本.

I think the Azure JARs you are using require a newer version of hadoop-common than the 2.7.3 one that NiFi is using.

如果您查看 2.7.3 中的 Configuration 类,则没有reloadExistingConfiguration"方法:

If you look at the Configuration class from 2.7.3 there is no "reloadExistingConfiguration" method:

https://github.com/apache/hadoop/blob/release-2.7.3-RC2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java

它似乎是在 2.8.x 中引入的:

It appears to be introduced sometime during 2.8.x:

https://github.com/apache/hadoop/blob/release-2.8.3-RC0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java

这篇关于Nifi java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.reloadExistingConfigurations的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆