如何解决 MPJ Express 中的 "Connection refused" 错误?

How to solve "Connection refused" error in MPJ Express?

我 运行 我的 MPJ 程序使用 5 台同名 (DESKTOP-J49PIF5) 的 PC,但 IP 地址不同。它运行在实验室成功了。但是,当我尝试 运行 在新实验室(不同的地方)使用相同配置的相同程序时,出现“连接被拒绝”错误。

More info that may help. The same problem happened to my Apache Spark program, but I can solve the problem by adding "--conf “spark.driver.host=<<master_ip>>”" in the configuration. Someone said that the program can not find the driver host so we have to add that extra line in the configuration. Please note that in the previous laboratory I didn't add that line and either my MPJ and Spark program are working. <<

现在,我的问题是为什么我的 MPJ 程序出现“连接被拒绝”错误?如果问题与 Apache Spark 相同,那么我该如何配置 MPJ?也许通过添加类似于 Apache Spark 的 master_ip?但是我不知道怎么做。

... 5 台电脑重复此错误。

折腾了几天,终于找到了答案。问题出在主机名中。每台 PC 都有不同的 IP 地址,我可以 ping 通它们。但是,对于集群计算而不是使用 IP 地址,它使用主机名来相互联系,因此我们必须为每台 PC 提供一个唯一的主机名。我更改了所有主机名,程序 运行 正常。