gpt4 book ai didi

linux - 如何在 Centos 7 中使用 firewalld 启用 MPI mpirun

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:49:55 26 4
gpt4 key购买 nike

我正在尝试让 MPI 在 Centos 7 操作系统的小型集群上运行。防火墙阻止它运行。这是我得到的错误:

    $ mpirun -np 30 -hostfile hosts.txt mpi_sample_program/mpitest
------------------------------------------------------------
A process or daemon was unable to complete a TCP connection
to another process:
Local host: marcher5
Remote host: ***.***.***.***.***
This is usually caused by a firewall on the remote host. Please
check that any firewall (e.g., iptables) has been disabled and
try again.
------------------------------------------------------------
--------------------------------------------------------------------------
ORTE was unable to reliably start one or more daemons.
This usually is caused by:

* not finding the required libraries and/or binaries on
one or more nodes. Please check your PATH and LD_LIBRARY_PATH
settings, or configure OMPI with --enable-orterun-prefix-by-default

* lack of authority to execute on one or more specified nodes.
Please verify your allocation and authorities.

* the inability to write startup files into /tmp (--tmpdir/orte_tmpdir_base).
Please check with your sys admin to determine the correct location to use.

* compilation of the orted with dynamic libraries when static are required
(e.g., on Cray). Please check your configure cmd line and consider using
one of the contrib/platform definitions for your system type.

* an inability to create a connection back to mpirun due to a
lack of common network interfaces and/or no route found between
them. Please check network connectivity (including firewalls
and network routing requirements).
--------------------------------------------------------------------------

当我使用 sudo systemctl disable firewalld 禁用防火墙时,MPI 工作正常。一周以来,我一直在尝试添加一条规则,允许 MPI 在不关闭 firewalld 的情况下运行,但它还没有奏效。我能够用 sudo iptables -A INPUT -s -j ACCEPT 做到这一点并且它有效。但是现在由于 Centos 7,我必须使用 firewall-cmd。你建议我在不损害集群安全的情况下做什么。我是否应该添加一条规则以允许我的节点之间的所有流量?

我当前的 firewall-cmd 配置是:

$ firewall-cmd --list-all
work (default, active)
interfaces: eno1
sources:
services: dhcpv6-client ipp-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:

最佳答案

我尝试使用这个添加源:

sudo firewall-cmd --permanent --zone=work --add-source=[host_IP]

但还是无法使MPI应用程序正常运行。然后决定在这个集群上启用 MPI 的唯一方法是制定一个规则来接受节点之间的所有流量。我运行了这两个命令。

sudo firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -s  [server+IP] -j ACCEPT

firewall-cmd --reload

它的效果非常好。但不确定这是否是安全方面的最佳解决方案。

关于linux - 如何在 Centos 7 中使用 firewalld 启用 MPI mpirun,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32703920/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com