Spring-xd 不会在 HDFS 上写入来自 Twitter 的流

标签 spring hadoop twitter spring-xd

我正在写我的期末论文,但我对 Spring-xd 有疑问:

我从我的 xd-shell 运行:

stream create --name cyrustweets --definition "twitterstream --track='mileycyrus, miley cyrus' | log" --deploy

而且它有效。我的 xd-singlenode 向我显示推文。

但是当我尝试在 HDFS 上写入时:

stream create --name cyrustweets --definition "twitterstream --track='mileycyrus, miley cyrus' | hdfs" --deploy

xd-singlenode 显示下一个:

08:28:05,763 1.0.3.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Exception while reading stream. org.springframework.messaging.MessageHandlingException: failed to write Message payload to HDFS.

有什么帮助吗?我遵循了本教程: http://hortonworks.com/hadoop-tutorial/using-spring-xd-to-stream-tweets-to-hadoop-for-sentiment-analysis/

非常感谢

最佳答案

Caused by: java.net.ConnectException: Conexión rehusada

这意味着 HDFS 端口和/或主机名不正确(Connection Refused 英文)。

如果您使用的是较新版本的 Spring-XD,则 hadoop 连接属性在 servers.yml 中配置,具有以下默认值:

# Hadoop properties 
  hadoop:
    fsUri: hdfs://localhost:8020
    resourceManagerHost: localhost
    resourceManagerPort: 8032

关于Spring-xd 不会在 HDFS 上写入来自 Twitter 的流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27757031/

相关文章:

java - hibernate 搜索+ spring3 + jpa

Twitter oauth golang 得到错误 "code":32 ,"message" :"Could not authenticate you."

python - 如何使用 Tweepy 获取特定日期的推文?

javascript - 比较 JS 中最近日期的最佳方法?

java - Spring Cloud 与 Docker Swarm 和 Kubernetes 等编排工具的组合

spring - 如何启用 Ehcache 的日志记录

java - MyBatis 不持久存储过程调用

java - Apache Hadoop 2.6 Java堆空间错误

hadoop - hdfs moveFromLocal 不会跨数据节点分发副本 block

hadoop - 文件未正确放入分布式缓存