我是Flume的新手。我试图从Twitter提取数据,但我没有成功。 (我正在使用Cloudera Quickstart)
我的conf文件看起来像这样:
TwitterAgent.sources = Twitter
TwitterAgent.channels = MemChannel
TwitterAgent.sinks = HDFS
TwitterAgent.sources.Twitter.type = com.cloudera.flume.source.TwitterSource
TwitterAgent.sources.Twitter.channels = MemChannel
我添加了所有这些值,这些值都来自Twitter帐户consumerKey,consumerSecret,accessToken,accessTokenSecret,关键字和路径
TwitterAgent.sinks.HDFS.channel = MemChannel
TwitterAgent.sinks.HDFS.type = hdfs
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
我用来执行conf文件的命令是:
flume-ng agent --conf conf --conf-file flume.conf -Dflume.root.logger=DEBUG,console -name TwitterAgent
我得到的错误是:
18/06/27 12:17:18 WARN conf.FlumeConfiguration: Agent configuration for 'TwitterAgent' does not contain any valid channels. Marking it as invalid.
18/06/27 12:17:18 WARN conf.FlumeConfiguration: Agent configuration invalid for agent 'TwitterAgent'. It will be removed.
18/06/27 12:17:18 INFO conf.FlumeConfiguration: Post-validation flume configuration contains configuration for agents: []
18/06/27 12:17:18 WARN node.AbstractConfigurationProvider: No configuration found for this host:TwitterAgent
18/06/27 12:17:18 INFO node.Application: Starting new configuration:{ sourceRunners:{} sinkRunners:{} channels:{} }
请给我建议。
最佳答案
我认为您的执行命令中有问题,该错误与查找配置文件有关。
命令应该是
flume-ng agent -c conf -f conf/flume.conf -Dflume.root.logger=DEBUG,console -n TwitterAgent
您必须指定配置文件路径。您可以尝试 -f conf / flume.conf 代替 -f flume.conf
关于hadoop - Flume代理不包含任何有效 channel ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51070200/