【问题标题】:OpenMPI: Permission denied error while trying to use mpirunOpenMPI:尝试使用 mpirun 时出现权限被拒绝错误
【发布时间】:2016-03-05 20:33:22
【问题描述】:

我想借助以下代码在不同的 Google 云计算实例上通过 MPI 显示“hello world”:

from mpi4py import MPI

size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()
name = MPI.Get_processor_name()

print("Hello, World! I am process/rank {} of {} on {}.\n".format(rank, size, name))    

.

问题是,即使我可以毫无问题地跨所有这些实例进行 ssh-connect,但当我尝试运行我的脚本时,我会收到一条权限被拒绝的错误消息。我使用以下命令来调用我的脚本:

mpirun --host localhost,instance_1,instance_2 python hello_world.py

.

并得到以下错误信息:

Permission denied (publickey).
--------------------------------------------------------------------------
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).
--------------------------------------------------------------------------

.

附加信息:

  • 我在所有节点上都安装了 open-MPI
  • 我让 Google 通过使用 gcloud 从每个实例登录到每个实例来自动设置我的所有 ssh 密钥
  • 实例类型:n1-standard-1
  • instance-OS:Linux Debian(默认)

.

感谢您的帮助 :-)

.

新信息:
(感谢@Zulan 指出我应该编辑我以前的帖子,而不是为新信息创建新答案)

所以,我尝试用 mpich 而不是 openmpi 来做同样的事情。但是,我遇到了类似的错误消息。

命令:

mpirun --host localhost,instance_1,instance_2 python hello_world.py

.

错误信息:

Host key verification failed.

.

我可以毫无问题地在我的两个实例之间进行 ssh-connect,并且通过 gcloud 命令,ssh-keys 应该会自动正确设置。

那么,有人知道问题可能是什么吗?我还检查了路径、防火墙规则以及我在临时文件夹中编写启动脚本的能力。有人可以尝试重现这个问题吗? + 我应该向 Google 提出这个问题吗? (以前从未做过这样的事情,我很不确定:S)

感谢您的帮助:)

【问题讨论】:

    标签: python ssh mpi google-compute-engine permission-denied


    【解决方案1】:

    所以我终于找到了解决方案。哇,问题快把我逼疯了。

    事实证明,我需要手动生成 ssh 密钥才能使脚本正常工作。我不知道为什么,因为 google-services 已经通过使用设置了密钥 gcloud compute ssh ,但是很好,它起作用了:)

    我做的步骤:

    instance_1 $ ssh-keygen -t rsa
    instance_1 $ cd .ssh
    instance_1 $ cat id_rsa.pub >> authorized_keys
    instance_1 $ gcloud compute copy-files id_rsa.pub 
    instance_1 $ gcloud compute ssh instance_2
    
    instance_2 $ cd .ssh
    instance_2 $ cat id_rsa.pub >> authorized_keys
    

    .

    我将打开另一个主题并询问为什么我不能使用ssh instance_2,即使gcloud compute ssh instance_2 正在工作。见:Difference between the commands "gcloud compute ssh" and "ssh"

    【讨论】:

      猜你喜欢
      • 2012-06-09
      • 2018-11-19
      • 2019-01-30
      • 2019-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多