【问题标题】:Host key verification failed in google compute engine based mpich cluster基于谷歌计算引擎的 mpich 集群中的主机密钥验证失败
【发布时间】:2019-05-29 08:20:45
【问题描述】:

TLDR:

我有 2 个google compute engine 实例,我在两个实例上都安装了mpich。 当我尝试运行示例时,我得到Host key verification failed

详细版本:

我已按照本教程完成此任务:http://mpitutorial.com/tutorials/running-an-mpi-cluster-within-a-lan/

我有 2 个带有 ubuntu 14.04google compute engine vms(谷歌云帐户是试用版,顺便说一句)。我已经在两个实例上下载了这个版本的 mpich:http://www.mpich.org/static/downloads/3.3rc1 /mpich-3.3rc1.tar.gz,并使用以下步骤安装了它:

./configure --disable-fortran
sudo make
sudo make install

这是/etc/hosts 文件在master-node 上的样子:

127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
169.254.169.254 metadata.google.internal metadata
10.128.0.3 client
10.128.0.2 master
10.128.0.2 linux1.us-central1-c.c.ultimate-triode-161918.internal linux
1  # Added by Google
169.254.169.254 metadata.google.internal  # Added by Google

这就是/etc/hosts 文件在client-node 上的样子:

127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
169.254.169.254 metadata.google.internal metadata
10.128.0.2 master
10.128.0.3 client
10.128.0.3 linux2.us-central1-c.c.ultimate-triode-161918.internal linux
2  # Added by Google
169.254.169.254 metadata.google.internal  # Added by Google

其余步骤涉及在两个节点上添加一个名为 mpiuser 的用户,并在节点之间配置无密码 ssh 身份验证。并在节点之间配置cloud 共享目录。

到目前为止,配置一直有效。我已经把这个文件https://raw.githubusercontent.com/pmodels/mpich/master/examples/cpi.c下载到/home/mpiuser/cloud/mpi_sample.c,这样编译:

mpicc -o mpi_sample mpi_sample.c

并在以mpiuser 登录时在主节点上发出此命令:

 mpirun -np 2 -hosts client,master ./mpi_sample

我得到了这个错误:

Host key verification failed.

怎么了?我已尝试解决此问题超过 2 天,但我无法获得有效的解决方案。

【问题讨论】:

  • 此消息暗示无密码 SSH 确实工作!假设您从master 主机上的mpiuser 帐户调用mpirun,只需从那里调用ssh client,并接受或修复远程主机密钥。您可能必须在 client 主机上执行相同的操作。
  • @GillesGouaillardet 您将如何修复/接受远程主机上的密钥?
  • 你试过ssh client 吗?
  • @GillesGouaillardet 是的。我尝试手动重新生成密钥,但仍然出现该错误。
  • ssh client 说什么?

标签: google-cloud-platform mpi google-compute-engine mpich


【解决方案1】:

添加

package-lock.json

在“.gcloudignore 文件”中。

然后再次部署。

【讨论】:

    【解决方案2】:

    原来我的无密码 ssh 配置不正确。我创建了 2 个新实例并执行了以下操作以减少工作密码,从而获得该示例的工作版本。以下步骤在ubuntu server 18.04 上执行。

    首先,默认情况下,谷歌云上的实例已关闭PasswordAuthentication 设置。在 client 服务器中执行:

    sudo vim /etc/ssh/sshd_config
    

    并将PasswordAuthentication no 更改为PasswordAuthentication yes。那么

    sudo systemctl restart ssh
    

    ma​​ster 服务器生成 ssh 密钥:

    ssh-keygen -t rsa -b 4096 -C "user.mail@server.com"
    

    将生成的ssh密钥从ma​​ster服务器复制到client

    ssh-copy-id client
    

    现在您从 ma​​sterclient 获得了一个功能齐全的无密码 ssh。但是mpich 还是失败了。

    我所做的额外步骤是将公钥复制到 ma​​sterclient 上的 ~/.ssh/authorized_keys 文件中。所以从两台服务器上执行这个命令:

    sudo cat .ssh/id_rsa.pub >> .ssh/authorized_keys
    

    然后确保来自 clientserver/etc/ssh/sshd_config 文件具有以下配置:

    PasswordAuthentication no
    ChallengeResponseAuthentication no
    UsePAM no
    

    clientma​​ster

    重新启动 ssh 服务
    sudo systemctl restart ssh
    

    就是这样,mpich 现在可以顺利运行了。

    【讨论】:

      猜你喜欢
      • 2019-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-15
      • 2021-12-25
      • 2013-02-16
      • 1970-01-01
      • 2020-07-15
      相关资源
      最近更新 更多