【发布时间】:2016-11-21 07:53:03
【问题描述】:
我的意图是在同一台计算机/服务器上的 R 中启动两个或多个 h2o 集群/实例(不是两个或更多节点!),以使多个用户能够同时连接到 h2o时间。此外,我希望能够单独关闭和重新启动集群,也可以在 R 中。
我已经知道我不能简单地从 R 中控制多个 h2o 集群,因此我尝试从 Windows 10 中的命令行启动两个集群:
java -Xmx1g -jar h2o.jar -name testCluster1 -nthreads 1 -port 54321
java -Xmx1g -jar h2o.jar -name testCluster2 -nthreads 1 -port 54323
这对我来说很好用:
library(h2o)
h2o.init(startH2O = FALSE, ip = "localhost", port = 54321)
Connection successful!
R is connected to the H2O cluster:
H2O cluster uptime: 4 minutes 8 seconds
H2O cluster version: 3.8.3.2
H2O cluster name: testCluster
H2O cluster total nodes: 1
H2O cluster total memory: 0.87 GB
H2O cluster total cores: 4
H2O cluster allowed cores: 1
H2O cluster healthy: TRUE
H2O Connection ip: localhost
H2O Connection port: 54321
H2O Connection proxy: NA
R Version: R version 3.2.5 (2016-04-14)
h2o.init(startH2O = FALSE, ip = "localhost", port = 54323)
Connection successful!
R is connected to the H2O cluster:
H2O cluster uptime: 3 minutes 32 seconds
H2O cluster version: 3.8.3.2
H2O cluster name: testCluster2
H2O cluster total nodes: 1
H2O cluster total memory: 0.87 GB
H2O cluster total cores: 4
H2O cluster allowed cores: 1
H2O cluster healthy: TRUE
H2O Connection ip: localhost
H2O Connection port: 54323
H2O Connection proxy: NA
R Version: R version 3.2.5 (2016-04-14)
现在,我想通过 system() 命令在 R 中做同样的事情。
launchH2O <- as.character("java -Xmx1g -jar h2o.jar -name testCluster -nthreads 1 -port 54321")
system(command = launchH2O, intern =TRUE)
但我收到一条错误消息:
[1] "Error: Unable to access jarfile h2o.jar"
attr(,"status")
[1] 1
Warning message:
running command 'java -Xmx1g -jar h2o.jar -name testCluster -nthreads 1 -port 54321' had status 1
尝试
system2(command = launchH2O)
我收到一条警告消息,我无法连接集群:
system2(command = launchH2O)
Warning message:
running command '"java -Xmx1g -jar h2o.jar -name testCluster -nthreads 1 -port 54321"' had status 127
h2o.init(startH2O = FALSE, ip = "localhost", port = 54321)
Error in h2o.init(startH2O = FALSE, ip = "localhost", port = 54321) :
Cannot connect to H2O server. Please check that H2O is running at http://localhost:54321/
任何想法如何从 R 中启动/关闭两个或多个 h2o 集群? 提前谢谢!
注意 1: 我只是使用本地 Windows 设备进行测试,实际上我想在 Linux 服务器上创建多个 h2o 集群。
注意 2: 我在 R GUI (3.2.5) 和 R Studio (Version 0.99.892) 上都试过了,我以管理员身份运行它们。 h2o.jar 文件在我的工作目录中,我的 Java 版本是 (Build 1.8.0_91-b14)。
注3:系统信息: - h2o & h2o R 包版本:3.8.3.2 - Windows 10 家庭版,版本 1511 - 16 RAM,英特尔酷睿 i5-6200U CPU,频率为 2,30 GHz
【问题讨论】:
-
考虑运行 linux,即使是作为 vm 来宾。使用开源时,它通常会提高生产力。仅当您部署到该平台(即天蓝色)时,IMO win 开发机器才有意义。
标签: r windows cmd cluster-computing h2o