首页 > 解决方案 > R Google Compute Engine 创建集群错误

问题描述

我正在尝试创建一个包含在 GCE 上的虚拟机上的 R 集群。我遵循了googleComputeEngineR中的示例。我已经粘贴了下面的代码。

######
vm_names <- paste0("cpu",1:2)

## specify the cheapest VMs that may get turned off
preemptible = list(preemptible = TRUE)

## start up 2 VMs with R base on them (can also customise via Dockerfiles using gce_vm_template instead)
fiftyvms <- lapply(vm_names, gce_vm, predefined_type = "n1-standard-1",
                   template = "r-base", scheduling = preemptible)

## add any ssh details, username etc.
fiftyvms <- lapply(fiftyvms, gce_ssh_setup)

## once all launched, add to cluster
plan(cluster, workers = as.cluster(fiftyvms))

基本上,我可以创建虚拟机并建立对它们的 SSH 访问,但 socketConnection 一直超时。有什么想法可能是错的吗?

这是我得到的输出:

2018-10-10 20:27:20> 创建模板虚拟机

2018-10-10 20:27:22> 检查操作...待处理

2018-10-10 20:27:33> 运行中...

2018-10-10 20:27:53> 操作在 17 秒内完成

2018-10-10 20:27:53> 外部 IP 例如 cpu1:35.240.99.251

2018-10-10 20:27:53> ## VM r-base 在 35.240.99.251 运行

2018-10-10 20:27:53> 等待几分钟,让初始 docker 容器下载并安装,然后再登录。

2018-10-10 20:27:54> 虚拟机运行

2018-10-10 20:27:59> 创建模板虚拟机

2018-10-10 20:28:01> 检查操作...待处理

2018-10-10 20:28:21> 操作在 5 秒内完成

2018-10-10 20:28:22> 外部 IP 例如 cpu2:35.205.28.126

2018-10-10 20:28:22> ## VM r-base 在 35.205.28.126 运行

2018-10-10 20:28:22> 等待几分钟,让初始 docker 容器下载并安装,然后再登录。

2018-10-10 20:28:23> 虚拟机运行

 ## add any ssh details, username etc.
 fiftyvms <- lapply(fiftyvms, gce_ssh_setup)

2018-10-10 20:28:30> SSH 公钥上传到实例

2018-10-10 20:28:38> SSH 公钥上传到实例

## once all launched, add to cluster
plan(cluster, workers = as.cluster(fiftyvms))

2018-10-10 20:28:59> 外部 IP 例如 cpu1:35.240.99.251

socketConnection 中的错误(“localhost”,端口 = 端口,服务器 = TRUE,阻塞 = TRUE,:

已达到已用时间限制

标签: rcluster-computinggoogle-compute-enginerparallelr-future

解决方案


推荐阅读