我没有收到来自推特的推文
Posted
技术标签:
【中文标题】我没有收到来自推特的推文【英文标题】:I am not getting the tweets from twitter 【发布时间】:2015-06-06 09:32:00 【问题描述】:我尝试在 HDFS 中通过 Flume 流式传输推文,但我没有从 twitter 获得推文。该过程在下面提到的这一点停止.... !!没有超出这一步。
INFO instrumentation.MonitoredCounterGroup: Monitoried counter group for type: SINK, name: HDFS, registered successfully.
INFO instrumentation.MonitoredCounterGroup: Component type: SINK, name: HDFS started
我的 flume.conf 文件:
TwitterAgent.sources = Twitter
TwitterAgent.channels = MemChannel
TwitterAgent.sinks = HDFS
TwitterAgent.sources.Twitter.type = org.apache.flume.source.twitter.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 = big data,cloud,hadoop,data analysis,hive,pig,hbase,flume,datawarehouse
TwitterAgent.sinks.HDFS.channel = MemChannel
TwitterAgent.sinks.HDFS.type = hdfs
TwitterAgent.sinks.HDFS.hdfs.path = hdfs://localhost:9000/Big
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
【问题讨论】:
您希望分享的任何代码都会很有用 请在原始帖子中包含此内容,编辑并删除这些 cmets 好的,如果可以的话,请帮助我。 您能否检查并发布试试这个代码..
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 = xxxxxxxxxxxxxxx
TwitterAgent.sources.Twitter.consumerSecret = xxxxxxxxxxxx
TwitterAgent.sources.Twitter.accessToken = xxxxxxxxxxxxxxx
TwitterAgent.sources.Twitter.accessTokenSecret = xxxxxxxxx
TwitterAgent.sources.Twitter.keywords = big data,cloud,hadoop,data analysis,hive,pig,hbase,flume,datawarehouse
TwitterAgent.sinks.HDFS.channel = MemChannel
TwitterAgent.sinks.HDFS.type = hdfs
TwitterAgent.sinks.HDFS.hdfs.path = hdfs://localhost:9000/Big
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.sinks.HDFS.hdfs.filePrefix = twitter_India-
TwitterAgent.sinks.HDFS.hdfs.round = true
TwitterAgent.sinks.HDFS.hdfs.roundValue = 2
TwitterAgent.sinks.HDFS.hdfs.roundUnit = minute
TwitterAgent.channels.MemChannel.type = memory
TwitterAgent.channels.MemChannel.capacity = 10000
TwitterAgent.channels.MemChannel.transactionCapacity = 100
【讨论】:
到这一步就停止了!!没有建立连接! INFO instrumentation.MonitoredCounterGroup:组件类型:SINK,名称:HDFS 启动 它对我来说工作得很好,你需要检查这个所需的外部 jar..【参考方案2】:在flume.conf
文件中
TwitterAgent.sinks.HDFS.hdfs.path = hdfs://localhost:**9000**/Big
将您自己的 Active localhost 替换为 9000。
转到http://localhost:50070/,您可以看到您的活动本地主机。就像我的情况一样
TwitterAgent.sinks.HDFS.hdfs.path=hdfs://localhost:54310/user/flume/tweets
【讨论】:
以上是关于我没有收到来自推特的推文的主要内容,如果未能解决你的问题,请参考以下文章