【问题标题】:Apache Flume connection to the twitter API 401:Authentication credentialsApache Flume 连接到 twitter API 401:身份验证凭据
【发布时间】:2014-03-14 17:08:03
【问题描述】:

我正在尝试使用 Apache Flume 将推文保存到我的 HDFS。我目前正在将 Cloudera 映像与 Hadoop 和 Flume 一起使用。我正在关注 Cloudera 博客中的教程,但我无法连接到 Twitter API。

我收到以下错误:

2014-03-14 09:43:14,021 INFO org.apache.flume.node.Application: Waiting for channel: MemChannel to start. Sleeping for 500 ms
2014-03-14 09:43:14,069 INFO org.apache.flume.instrumentation.MonitoredCounterGroup: Monitored counter group for type: CHANNEL, name: MemChannel: Successfully registered new MBean.
2014-03-14 09:43:14,069 INFO org.apache.flume.instrumentation.MonitoredCounterGroup: Component type: CHANNEL, name: MemChannel started
2014-03-14 09:43:14,522 INFO org.apache.flume.node.Application: Starting Sink HDFS
2014-03-14 09:43:14,522 INFO org.apache.flume.node.Application: Starting Source Twitter
2014-03-14 09:43:14,525 INFO org.apache.flume.instrumentation.MonitoredCounterGroup: Monitored counter group for type: SINK, name: HDFS: Successfully registered new MBean.
2014-03-14 09:43:14,525 INFO org.apache.flume.instrumentation.MonitoredCounterGroup: Component type: SINK, name: HDFS started
2014-03-14 09:43:14,595 INFO twitter4j.TwitterStreamImpl: Establishing connection.
2014-03-14 09:43:14,680 INFO org.mortbay.log: Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
2014-03-14 09:43:14,823 INFO org.mortbay.log: jetty-6.1.26
2014-03-14 09:43:14,946 INFO org.mortbay.log: Started SocketConnector@0.0.0.0:41414
2014-03-14 09:43:16,249 INFO twitter4j.TwitterStreamImpl: 401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.

HTTP ERROR: 401

Problem accessing '/1.1/statuses/filter.json'. Reason:
Unauthorized



2014-03-14 09:43:16,249 INFO twitter4j.TwitterStreamImpl: Waiting for 10000 milliseconds
2014-03-14 09:43:26,251 INFO twitter4j.TwitterStreamImpl: Establishing

我已将我的 twitter API 凭据复制到 flume.conf(我在磁盘和 Web UI 上都尝试过)。我也尝试过重新生成它们并复制那些新的,但这对我没有帮助。

我的 pom.xml 包含:

<dependency>
  <groupId>org.twitter4j</groupId>
  <artifactId>twitter4j-stream</artifactId>
  <version>3.0.5</version>
</dependency>

这意味着不应该存在here 描述的问题。

而且我还通过命令设置了系统时间:

sudo ntpdate pool.ntp.org

有人知道什么可能是错的吗? 非常感谢您的任何建议和帮助。

【问题讨论】:

    标签: hadoop twitter cloudera flume cloudera-manager


    【解决方案1】:

    尝试升级到 Twitter4J 3.0.6。我通过升级到 3.0.6 解决了类似的问题

    【讨论】:

    • 我已经更新了 3.0.6,但不幸的是我仍然遇到同样的错误。
    【解决方案2】:

    更新: 这是因为无效的消费者密钥/秘密、访问令牌/秘密,并确保系统时钟同步。”

    【讨论】:

      猜你喜欢
      • 2013-04-11
      • 1970-01-01
      • 2015-06-01
      • 2018-08-27
      • 1970-01-01
      • 1970-01-01
      • 2013-09-22
      • 2019-04-07
      • 2015-03-20
      相关资源
      最近更新 更多