apacheflume到twitterapi401的连接:身份验证凭证

5w9g7ksd  于 2021-06-04  发布在  Hadoop
关注(0)|答案(2)|浏览(312)

我正在尝试使用apacheflume将tweets保存到hdfs中。我目前正在使用cloudera映像和hadoop和flume。我在cloudera的博客上学习教程,但是我无法连接到twitterapi。
我收到以下错误:

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

我已经将我的twitterapi凭证复制到flume.conf(我已经在光盘和web用户界面上进行了尝试)。我也试着重新生成它们,并复制那些新的,但它没有帮助我。
my pom.xml包含:

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

这意味着不应该有这里描述的问题。
我还通过命令设置了系统时间:

sudo ntpdate pool.ntp.org

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

f0brbegy

f0brbegy1#

更新:由于使用者密钥/密码、访问令牌/密码无效,请确保系统时钟同步。“

sz81bmfz

sz81bmfz2#

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

相关问题