Flume在配置文件上失败

时间:2013-12-13 15:49:38

标签: flume

我有一些我继承的代码,而且文档很少。系统不断出现各种错误。在我看来,它不是读取jar文件,我甚至不确定它在哪里。这是下面的错误。有人可以提供任何建议吗?

     - Creating instance of source Twitter, type uk.co.senym.flume.TweetDataSource
    13 Dec 2013 15:29:55,923 ERROR [conf-file-poller-0](org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run:142)  - Failed to load configuration data. Exception follows.
    org.apache.flume.FlumeException: Unable to load source type: uk.co.senym.flume.TweetDataSource, class: uk.co.senym.flume.TweetDataSource
    at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:67)
    at org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:40)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:327)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
    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:724)
Caused by: java.lang.ClassNotFoundException: uk.co.senym.flume.TweetDataSource
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at                                         org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:65)
    ... 11 more

1 个答案:

答案 0 :(得分:1)

如果您使用的是最新版本的Flume,那么您应该使用plugins.d目录。

我现在假设您使用的是Bigtop派生的分发版,例如Cloudera CDH4。然后你想看一下@ /etc/flume-ng/conf/flume-env.sh来看看他们是否在定制Flume类路径以指向你的自定义twitter源的jar文件。

这是旧的方式,它有点糟糕。更好的方法是将您的东西放入plugins.d中,如下所示:http://archive.cloudera.com/cdh4/cdh/4/flume-ng/FlumeUserGuide.html#installing-third-party-plugins

我相信CDH4上的默认plugins.d目录是/var/lib/flume-ng/plugins.d

HTH