我想在CDH-5.3.2版本中使用flume从twitter中提取数据。我已经配置了flume.conf,hbase sink和twitter源代码。
但是,当我启动代理时,我得到以下错误:
2015-06-29 16:57:15,115 ERROR org.apache.flume.lifecycle.LifecycleSupervisor: Unable to start EventDrivenSourceRunner: { source:com.cloudera.flume.source.TwitterSource{name:Twitter,state:IDLE} } - Exception follows.
java.lang.IllegalStateException: Authentication credentials are missing. See http://twitter4j.org/configuration.html for the detail.
at twitter4j.TwitterBaseImpl.ensureAuthorizationEnabled(TwitterBaseImpl.java:200)
at twitter4j.TwitterStreamImpl.sample(TwitterStreamImpl.java:159)
at com.cloudera.flume.source.TwitterSource.start(TwitterSource.java:121)
at org.apache.flume.source.EventDrivenSourceRunner.start(EventDrivenSourceRunner.java:44)
at org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:251)
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)
flume.conf和hbase接收器代码与此博客相同:http://ahikmat.blogspot.com/2014/08/streaming-twitter-tweets-to-hbase-with.html
而且,Twitter源代码与https://github.com/cloudera/cdh-twitter-example/tree/master/flume-sources/src/main/java/com/cloudera/flume/source
相同我不了解twitter4j中的auth错误,无论是回调网址设置/ Twitter源代码有什么问题。
答案 0 :(得分:1)
您已在TwitterSourceConstants.java中添加了您的消费者密钥和密码? 如果您已完成此操作,则应撤消此编辑。信息必须在flume.conf文件中。 twitter_flume有一个例子。查看flume sources文件夹,有flume.conf文件。
希望有所帮助