问题:
在多节点环境上运行MPI程序,出现错误:
HYDU_sock_connect (utils/sock/sock.c:145): unable to connect from "2" to "1" (No route to host)
main (pm/pmiserv/pmip.c:183): unable to connect to server digital4.ocean at port 42355 (check for firewalls!)
HYDU_sock_connect (utils/sock/sock.c:145): unable to connect from "3" to "1" (No route to host)
main (pm/pmiserv/pmip.c:183): unable to connect to server digital4.ocean at port 42355 (check for firewalls!)
解决:
1、关闭防火墙
关闭防火墙,即可运行成功
systemctl stop firewalld
2、修改hosts文件
可能是客户端连接不到服务器引起的,在客户端的host文件中添加相关的ip和主机名,如node2中:
10.10.1.12 node1
10.10.1.56 node3
3、防火墙添加富规则
在node1(服务端)的防火墙中添加富规则:
firewall-cmd --add-rich-rule='rule family="ipv4" source address="(node2的ip)" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="(node3的ip)" accept'
查看添加的富规则:
firewall-cmd --list-rich-rules
移除添加的富规则:
firewall-cmd --remove-rich-rule='rule family="ipv4" source address="(node2的ip)" accept'
firewall-cmd --remove-rich-rule='rule family="ipv4" source address="(node3的ip)" accept'