使用mpi4py验证主机密钥失败

时间:2015-07-21 09:57:54

标签: python ssh mpi mpi4py archlinux-arm

我正在使用Arch Linux ARM中的mpi4py(1.3.1)和openmpi(1.8.6-1)构建一个MPI应用程序(在Raspberry Pi集群上,更具体一点)。我已经在3个节点(4个进程)上成功运行我的程序,当尝试添加新节点时,会发生以下情况:

Host key verification failed.
--------------------------------------------------------------------------
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).

有趣的是,ssh键很好,因为我使用相同的节点(我可以删除主机文件的任何条目,添加新节点,它会工作,所以我很确定问题不在于配置错误的ssh设置。只有当我使用5个进程时才会发生。)

这可能是某种库中的错误吗?

这是我的主机文件

192.168.1.26 slots=2
192.168.1.188 slots=1
#192.168.1.202 slots=1 If uncommented and run with -np 5, it will raise the error
192.168.1.100 slots=1

提前致谢!

1 个答案:

答案 0 :(得分:5)

我在运行Fedora 22和OpenMPI 1.8的Linux x86_64迷你群集上遇到了同样的问题。我可以通过我的启动机器连接到我的5台机器中的任何一台,但是当我尝试使用3个或更多节点启动MPI时,它会给我一个身份验证错误。和你一样,看起来3是一个神奇的数字,事实证明它是。 OpenMPI使用基于树的启动,因此当您有两个以上的节点时,一个或多个中间节点正在执行ssh。就我而言,我没有使用无密码设置。我在启动机器上有一个SSH身份,我已经添加到我的钥匙链中。它能够启动前两个节点,因为我在我的密钥链中具有经过身份验证的身份。然后每个节点尝试启动更多,并且那些节点没有经过身份验证的密钥(我需要在每个节点上添加它)。

因此解决方案似乎正在转向无密码的SSH身份设置,但您显然必须小心如何执行此操作。我在启动机器上创建了一个特定的身份(密钥对)。我将密钥添加到我想要使用的节点上的授权密钥上(这很简单,因为它们都使用NFS,但如果需要,您可以手动分配密钥一次)。然后我修改了我的SSH配置,以便在尝试转到我的节点机器时使用无密码身份。我的〜/ .ssh / config看起来像:

Host node0
    HostName node0
    IdentityFile ~/.ssh/passwordless_rsa
Host node1
    HostName node1
    IdentityFile ~/.ssh/passwordless_rsa
...

我确定有一些方法可以使用通配符对N个节点进行缩放。或者您可以考虑在系统ssh配置文件中更改系统级别的默认身份文件(我打赌在那里可以使用类似的选项)。

这就是诀窍。现在我可以启动所有5个节点而不会出现任何身份验证问题我的想法中的缺陷是启动节点将启动所有其他节点,但这种基于树的启动意味着您需要链接登录,这是您无法使用密码验证身份验证身份,因为您永远不会有机会对其进行身份验证。

拥有无密码密钥仍然让我感到不安,所以为了在连接到开放网络的这些节点上保持额外的安全,我更改了sshd配置(系统级别)以限制登录到除我来自我的启动节点之外的任何人