如何解析java.net.connectexception:连接被拒绝错误

t3irkdon  于 2021-05-29  发布在  Spark
关注(0)|答案(0)|浏览(199)

我有一个spark程序,它将消息写入另一个kafka主题,并将检查点本地写入hdfs系统

val query = kafkaDf.writeStream.format("kafka").option("kafka.bootstrap.servers",conf.getString("bootstrap.servers")).option("topic","RTA-ALERT").option("checkpointLocation","hdfs://localhost:9000/user/checkpoint8").option("failOnDataLoss", "false").start()

这些是core-site.xml的内容

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

这在我的ide上运行得很好。但是,当我将它打包为jar时,我会在emr集群上运行它。我得到以下错误。

Call From ip-xxx-xx-xx-86/xxx.xx.xx.86 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused

这些是emr集群主节点上core-site.xml的内容

<property>
    <!-- URI of NN. Fully qualified. No IP.-->
    <name>fs.defaultFS</name>
    <value>hdfs://ip-xxx-xx-xx-86.ec2.internal:8020</value>
  </property>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题