从Twitter流数据时如何解决水槽中的404错误?

时间:2018-07-02 12:37:12

标签: hadoop twitter flume flume-ng

我正在尝试使用flume从Twitter API传输一些数据。该代码最初确实有效。但现在我收到404错误:

INFO twitter4j.TwitterStreamImpl: 404: The URI requested is invalid or the resource requested, such as a user, does not exist.

Unknown URL. See Twitter Streaming API documentation at http://dev.twitter.com/pages/streaming_api 

下面是我的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=<code>
TwitterAgent.sources.Twitter.consumerSecret=    <code>
TwitterAgent.sources.Twitter.accessToken=<code>
TwitterAgent.sources.Twitter.accessTokenSecret= <code>

TwitterAgent.sources.Twitter.keywords= hadoop, bigdata

TwitterAgent.sinks.HDFS.channel=MemChannel
TwitterAgent.sinks.HDFS.type=hdfs
TwitterAgent.sinks.HDFS.hdfs.path=hdfs://localhost:8020/user/flume/tweets
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.rollInterval=600
TwitterAgent.channels.MemChannel.type=memory
TwitterAgent.channels.MemChannel.capacity=10000
TwitterAgent.channels.MemChannel.transactionCapacity=100

1 个答案:

答案 0 :(得分:0)

我只是手动同步了VMware和Windows系统的时间,问题得以解决。