7

我正在尝试在 AWS EC2 集群上的 R 中并行运行分析。我正在使用 starcluster 来设置和管理 EC2 集群,并尝试在 R 中使用snowforeach。首先,我在集群中有 2 个节点,1 个主节点和 1 个工作节点。

starcluster start mycluster 
starcluster listinstances

-----------------------------------------
mycluster (security group: @sc-mycluster)
-----------------------------------------
....
Cluster nodes:
     master running i-xxxxxxxxx masterIP.compute-1.amazonaws.com
    node001 running i-xxxxxxxxx node001IP.compute-1.amazonaws.com
Total nodes: 2

starcluster sshmaster mycluster

然后我启动 R 并加载snow包并尝试创建一个集群对象。

R
library("snow")

cl = makeCluster(c("masterIP.compute-1.amazonaws.com", "node001IP.compute-1.amazonaws.com"), type = "SOCK")

但是,这给了我以下错误消息:

The authenticity of host 'masterIP.compute-1.amazonaws.com (xx.xxx.xx.xx)' can't be established.
ECDSA key fingerprint is xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'masterIP.compute-1.amazonaws.com,xx.xxx.xx.xx' (ECDSA) to the list of known hosts.
Permission denied (publickey).

因此,我尝试将我的 ssh 密钥(keyname.rsa具体而言)复制到 EC2 上的 .ssh 文件并再次尝试。那仍然没有用;我收到了同样的 Permission denied (publickey).错误。我认为 starcluster 处理了 ssh 的设置和节点之间的通信,所以我有点困惑为什么我无法设置它。我也尝试只添加 node001, so cl = makeCluster(c("node001IP.compute-1.amazonaws.com"), type = "SOCK"),但发生同样的错误。

4

1 回答 1

2

事实证明,经过多次修改,所需要的只是更新到 R 版本 2.15。之后该命令cl = makeCluster(c("masterIP.compute-1.amazonaws.com", "node001IP.compute-1.amazonaws.com"), type = "SOCK")完美运行。

于 2013-02-04T06:45:39.173 回答