运行flume以下载twitter数据时出现未处理的错误java.lang.NoSuchMethodError

时间:2015-10-31 17:31:42

标签: java hadoop flume flume-ng flume-twitter

当我运行此命令时

hduser@ubuntu:/usr/local/flume$ bin/flume-ng agent --conf ./conf/ -f conf/twitterflume-agent.conf -Dflume.root.logger=DEBUG,console -n TwitterAgent

水槽开始了,但经过一段时间后,它抛出了我不允许下载水槽的例外情况。我收到以下错误:

2015-10-31 10:18:32,152 (conf-file-poller-0) [INFO - org.apache.flume.sink.DefaultSinkFactory.create(DefaultSinkFactory.java:40)] Creating instance of sink: HDFS, type: hdfs

2015-10-31 10:18:35,386 (conf-file-poller-0) [ERROR - org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:149)] Unhandled error
java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.refreshAfterWrite(JLjava/util/concurrent/TimeUnit;)Lcom/google/common/cache/CacheBuilder;
    at org.apache.hadoop.security.Groups.<init>(Groups.java:97)
    at org.apache.hadoop.security.Groups.<init>(Groups.java:74)
    at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:303)
    at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:283)
    at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:260)
    at org.apache.hadoop.security.UserGroupInformation.isAuthenticationMethodEnabled(UserGroupInformation.java:337)
    at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:331)
    at org.apache.flume.sink.hdfs.HDFSEventSink.authenticate(HDFSEventSink.java:491)
    at org.apache.flume.sink.hdfs.HDFSEventSink.configure(HDFSEventSink.java:240)
    at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSinks(AbstractConfigurationProvider.java:418)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:103)
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

发生此错误后,它会尝试检查但无法下载数据。

2015-10-31 10:28:05,446 (conf-file-poller-0) [DEBUG - org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:126)] Checking file:conf/twitterflume-agent.conf for changes
[enter image description here][1]

我对Hadoop和Flume更新鲜。

1 个答案:

答案 0 :(得分:1)

看起来像编译和运行时库不兼容。 编译代码时和运行代码时存在的库之间存在差异。

检查在运行水槽代码时是否提供了正确的类路径。 在运行代理程序的节点上,运行ps aux|grep flume以检查类路径。

另请注意,如果您更改了Twitter代码并增加了库,则会导致此问题,因为Flume还附带了自己的Twitter源代码。在这种情况下,要么删除Twitter罐子,要么更好地从类路径中移除Flume的twitter罐子。