基于Google计算引擎的mpich群集中的主机密钥验证失败

时间:2019-01-02 17:16:39

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

TLDR:

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

详细版本:

为了完成此任务,我已经按照本教程进行操作:http://mpitutorial.com/tutorials/running-an-mpi-cluster-within-a-lan/

我有2个google compute engine的{​​{1}}虚拟机(谷歌云帐户是一个试用版,顺便说一句)。我已经在以下两个实例上下载了该版本的mpich:ubuntu 14.04,并通过以下步骤安装了它:

http://www.mpich.org/static/downloads/3.3rc1
/mpich-3.3rc1.tar.gz

这是./configure --disable-fortran sudo make sudo make install 文件在/etc/hosts节点上的显示方式:

master

这是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

其余步骤涉及在两个节点上添加名为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 的用户,以及在节点之间配置无密码ssh身份验证。并在节点之间配置mpiuser共享目录。

配置一直到此为止。我已将此文件https://raw.githubusercontent.com/pmodels/mpich/master/examples/cpi.c下载到cloud,并通过以下方式进行编译:

/home/mpiuser/cloud/mpi_sample.c

并以mpicc -o mpi_sample mpi_sample.c 登录后在主节点上发出此命令:

mpiuser

我收到此错误:

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

怎么了?我已尝试解决此问题超过2天,但是我找不到有效的解决方案。

enter image description here

2 个答案:

答案 0 :(得分:1)

添加

package-lock.json

在“.gcloudignore 文件”中。

然后再次部署。

答案 1 :(得分:0)

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

首先,默认情况下,Google云上的实例已关闭PasswordAuthentication设置。在客户端服务器中,执行以下操作:

sudo vim /etc/ssh/sshd_config

,然后将PasswordAuthentication no更改为PasswordAuthentication yes。然后

sudo systemctl restart ssh

使用以下方法从主服务器服务器生成一个ssh密钥:

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

将生成的ssh密钥从主服务器服务器复制到客户端

ssh-copy-id client

现在,您从 master client 的密码减少了ssh的功能。但是mpich仍然失败。

我要做的其他步骤是在 master client 上将公钥复制到~/.ssh/authorized_keys文件中。因此,请从两个服务器上执行以下命令:

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

然后确保来自客户端服务器/etc/ssh/sshd_config文件具有以下配置:

PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

客户端主服务器

重新启动ssh服务
sudo systemctl restart ssh

就是这样,mpich现在可以正常工作。