我正在写我的期末论文,但我对 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/