使用Flume将推文写入HDFS并不起作用

时间:2014-05-27 15:48:51

标签: hadoop twitter hdfs cloudera flume

我将Cloudera CDH5 QuickStart VM与VMware一起使用,所有服务都通过Cloudera Manager安装。

我创建了/ user / flume / tweets和一个flume用户和组。我重新启动了所有服务但是,等待多久并不重要,没有推文会写入HDFS。 / user / flume / tweets /目录仍然是EMPTY!

为什么?

这是我的flume.conf:

TwitterAgent.sources = Twitter
TwitterAgent.channels = MemChannel
TwitterAgent.sinks = HDFS
TwitterAgent.sources.Twitter.type = com.cloudera.flume.source.TwitterSource
TwitterAgent.sources.Twitter.channels = MemChannel
TwitterAgent.sources.Twitter.consumerKey = **
TwitterAgent.sources.Twitter.consumerSecret = **
TwitterAgent.sources.Twitter.accessToken = **
TwitterAgent.sources.Twitter.accessTokenSecret = ***
TwitterAgent.sources.Twitter.keywords = hadoop, big data, analytics, bigdata, cloudera,        data science, data scientiest, business intelligence, mapreduce, data warehouse, data     warehousing, mahout, hbase, nosql, newsql, businessintelligence, cloudcomputing
TwitterAgent.sinks.HDFS.channel = MemChannel
TwitterAgent.sinks.HDFS.type = hdfs
TwitterAgent.sinks.HDFS.hdfs.path =     hdfs://localhost.localdomain:804/user/flume/tweets/%Y/%m/%d/%H/
TwitterAgent.sinks.HDFS.hdfs.fileType = DataStream
TwitterAgent.sinks.HDFS.hdfs.writeFormat = Text
TwitterAgent.sinks.HDFS.hdfs.batchSize = 1000
TwitterAgent.sinks.HDFS.hdfs.rollSize = 0
TwitterAgent.sinks.HDFS.hdfs.rollCount = 10000
TwitterAgent.channels.MemChannel.type = memory
TwitterAgent.channels.MemChannel.capacity = 10000
TwitterAgent.channels.MemChannel.transactionCapacity = 100

这就是我对水槽日志的看法:

[cloudera@localhost ~]$ tail -f /var/log/flume-ng/flume.log
27 May 2014 21:40:28,536 INFO  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016)  -     Processing:HDFS
27 May 2014 21:40:28,536 INFO  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016)  -     Processing:HDFS
27 May 2014 21:40:28,536 INFO  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016)  -     Processing:HDFS
27 May 2014 21:40:28,537 INFO  [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016)  -     Processing:HDFS
27 May 2014 21:40:28,537 INFO  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016)  -     Processing:HDFS
27 May 2014 21:40:28,562 WARN  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.isValid:319)  - Agent     configuration for 'agent' does not contain any channels. Marking it as invalid.
27 May 2014 21:40:28,564 WARN  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration.validateConfiguration:127)  - Agent configuration     invalid for agent 'agent'. It will be removed.
27 May 2014 21:40:28,564 INFO  [conf-file-poller-0]     (org.apache.flume.conf.FlumeConfiguration.validateConfiguration:140)  - Post-validation     flume configuration contains configuration for agents: [TwitterAgent]
27 May 2014 21:40:28,564 WARN  [conf-file-poller-0]     (org.apache.flume.node.AbstractConfigurationProvider.getConfiguration:138)  - No     configuration found for this host:agent
27 May 2014 21:40:28,592 INFO  [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:138)  - Starting new configuration:{     sourceRunners:{} sinkRunners:{} channels:{} }

我该如何解决?

提前致谢。

1 个答案:

答案 0 :(得分:0)

您是否使用Cloudera Manager设置了Flume配置?请点击此链接http://javet.org/?p=279在CDH5中实施twitter firehose。