首页 > 解决方案 > 在 R 中更新了 H2O,Flow 不会启动

问题描述

我通过半年前创建的 Amazon Ubuntu EC2 AMI 使用 H2O。它工作得很好:当需要时我启动一个实例,在 rstudio 中启动 H2O,进入流界面,做我的事情并再次关闭

但是当我尝试将 H2O 更新到最新版本时,我无法访问流。一切显然都在 rstudio 中有效,但不是流动的。我怀疑 Java、rstudio 的重新启动和/或 H2O 版本是最前沿的版本号,即使我请求最新的稳定版本也是如此。可以有

我按照这里的说明进行操作:

http://docs.h2o.ai/h2o/latest-stable/h2o-docs/downloading.html#install-in-r

这是 rstudio 控制台

h2o.init()

H2O is not running yet, starting it now...

Note:  In case of errors look at the following log files:
/tmp/RtmpKNp0jt/h2o_rstudio_started_from_r.out
/tmp/RtmpKNp0jt/h2o_rstudio_started_from_r.err

openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

Starting H2O JVM and connecting: .......... Connection successful!

R is connected to the H2O cluster: 
H2O cluster uptime:         22 seconds 380 milliseconds 
H2O cluster timezone:       Etc/UTC 
H2O data parsing timezone:  UTC 
H2O cluster version:        3.21.0.4364 
H2O cluster version age:    3 months and 13 days !!! 
H2O cluster name:           H2O_started_from_R_rstudio_urm169 
H2O cluster total nodes:    1 
H2O cluster total memory:   0.86 GB 
H2O cluster total cores:    2 
H2O cluster allowed cores:  2 
H2O cluster healthy:        TRUE 
H2O Connection ip:          localhost 
H2O Connection port:        54321 
H2O Connection proxy:       NA 
H2O Internal Security:      FALSE 
H2O API Extensions:         XGBoost, Algos, AutoML, Core V3, Core V4 
R Version:                  R version 3.4.2 (2017-09-28) 

Warning message:
In h2o.clusterInfo() : 
Your H2O cluster version is too old (3 months and 13 days)!
Please download and install the latest version from http://h2o.ai/download/

if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) }

[1] "A shutdown has been triggered. "

if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") }

Removing package from ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)

pkgs <- c("RCurl","jsonlite") for (pkg in pkgs) { + if (! (pkg %in% rownames(installed.packages()))) { install.packages(pkg) } + }

install.packages("h2o", type="source", repos=(c(" http://h2o-release.s3.amazonaws.com/h2o/latest_stable_R ")))

Installing package into ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'http://h2o-release.s3.amazonaws.com/h2o/latest_stable_R 
/src/contrib/h2o_3.23.0.4471.tar.gz'
Content type 'application/x-tar' length 120706169 bytes (115.1 MB)
==================================================
downloaded 115.1 MB

* installing *source* package ‘h2o’ ...
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (h2o)

The downloaded source packages are in
‘/tmp/RtmpKNp0jt/downloaded_packages’

图书馆(水)

Error: package or namespace load failed for ‘h2o’ in get(method, envir = 
home):
lazy-load database '/home/rstudio/R/x86_64-pc-linux-gnu- 
library/3.4/h2o/R/h2o.rdb' is corrupt
In addition: Warning message:
In get(method, envir = home) : internal error -3 in R_decompress1

由于错误消息,我通过 rstudio 中的菜单重新启动 R

Restarting R session...

图书馆(水)

----------------------------------------------------------------------

Your next step is to start H2O:
> h2o.init()

For H2O package documentation, ask for help:
> ??h2o

After starting H2O, you can use the Web UI at http://localhost:54321
For more information visit http://docs.h2o.ai

----------------------------------------------------------------------


Attaching package: ‘h2o’

The following objects are masked from ‘package:stats’:

cor, sd, var

The following objects are masked from ‘package:base’:

||, &&, %*%, apply, as.factor, as.numeric, colnames, colnames<-, ifelse, 
%in%,
is.character, is.factor, is.numeric, log, log10, log1p, log2, round, signif, 
trunc

h2o.init()

H2O is not running yet, starting it now...

Note:  In case of errors look at the following log files:
/tmp/RtmpMdVz9z/h2o_rstudio_started_from_r.out
/tmp/RtmpMdVz9z/h2o_rstudio_started_from_r.err

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Starting H2O JVM and connecting: . Connection successful!

R is connected to the H2O cluster: 
H2O cluster uptime:         1 seconds 744 milliseconds 
H2O cluster timezone:       Etc/UTC 
H2O data parsing timezone:  UTC 
H2O cluster version:        3.23.0.4471 
H2O cluster version age:    9 hours and 21 minutes  
H2O cluster name:           H2O_started_from_R_rstudio_rrc849 
H2O cluster total nodes:    1 
H2O cluster total memory:   0.86 GB 
H2O cluster total cores:    2 
H2O cluster allowed cores:  2 
H2O cluster healthy:        TRUE 
H2O Connection ip:          localhost 
H2O Connection port:        54321 
H2O Connection proxy:       NA 
H2O Internal Security:      FALSE 
H2O API Extensions:         XGBoost, Algos, AutoML, Core V3, Core V4 
R Version:                  R version 3.4.2 (2017-09-28) 

从这里开始,H2O 在 rstudio 中工作,但流程不会开始。

有什么建议么?

标签: rstudioh2o

解决方案


我建议更新到最新版本 3.22.0.1。然后初始化集群,使其不仅仅绑定到 localhost: init(bind_to_localhost=False)。当您从 R 或 Python 初始化 H2O 时,该实例默认绑定到 localhost,这意味着您可以从 RStudio 访问它,因为它在服务器上运行,但不能通过 Flow,因为您可以从远程浏览器访问它。

另一种选择是独立于命令行启动 H2O。

请注意,如果您不仅将 H2O 绑定到 localhost,那么任何可以访问端口和网络接口的人都可以访问它,这可能会造成重大的安全漏洞(暴露您的数据、模型等)。


推荐阅读