简体   繁体   English

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

[英]Writing Tweets to the HDFS using Flume doesn't work

I used the Cloudera CDH5 QuickStart VM with VMware and all the services are installed via the Cloudera Manager. 我将Cloudera CDH5 QuickStart VM与VMware一起使用,并且所有服务都是通过Cloudera Manager安装的。

I created a /user/flume/tweets and a flume user and group. 我创建了一个/ user / flume / tweets以及一个Flume用户和组。 I restarted all the services but, doesn't matter how long I wait, no tweets will be written to the HDFS. 我重新启动了所有服务,但是,无论等待多长时间,都不会将任何推文写入HDFS。 The /user/flume/tweets/ directory is still EMPTY! / user / flume / tweets /目录仍然为空!

Why? 为什么?

This is my flume.conf: 这是我的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

This is what I get on flume log: 这是我在水槽日志上得到的:

[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:{} }

How can I fix that? 我该如何解决?

Thanks in advance. 提前致谢。

Did you setup the Flume Configuration using Cloudera Manager? 您是否使用Cloudera Manager设置了Flume Configuration? Please follow this link http://javet.org/?p=279 for implementing twitter firehose in CDH5. 请点击此链接http://javet.org/?p=279,以在CDH5中实现twitter firehose。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM