R中的H2O初始化错误:h2o.init()中的错误:H2O无法启动,停止执行

时间:2016-06-29 13:28:44

标签: r initialization h2o

我正在尝试使用h的h2o。我已根据H2o网站上的说明安装了包,如下所示:

if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) }
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") }
pkgs <- c("methods","statmod","stats","graphics","RCurl","jsonlite","tools","utils")
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/rel-turchin/9/R")))

然后我在尝试按如下方式进行初始化时遇到了问题:

library(h2o)
localH2O <- h2o.init(nthreads = -1, max_mem_size = '2g')

错误如下:

> localH2O <- h2o.init()

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

Note:  In case of errors look at the following log files:
        /var/folders/yq/rhplvy_x14935793590w3tl80000gn/T//Rtmp4i5gnZ/h2o_Fan_started_from_r.out
        /var/folders/yq/rhplvy_x14935793590w3tl80000gn/T//Rtmp4i5gnZ/h2o_Fan_started_from_r.err

java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

Starting H2O JVM and connecting: ............................................................06-29 21:10:53.982 127.0.0.1:54321       18160  main      INFO: ----- H2O started  -----
06-29 21:10:54.020 127.0.0.1:54321       18160  main      INFO: Build git branch: rel-turchin
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Build git hash: 3da08b14a0f219fa1086c1c8d475e62fa3e16c29
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Build git describe: jenkins-rel-turchin-9
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Build project version: 3.8.2.9
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Built by: 'jenkins'
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Built on: '2016-06-10 13:25:13'
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Java availableProcessors: 8
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Java heap totalMemory: 245.5 MB
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Java heap maxMemory: 3.56 GB
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Java version: Java 1.8.0_20 (from Oracle Corporation)
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: JVM launch parameters: [-ea]
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: OS version: Mac OS X 10.10.5 (x86_64)
06-29 21:10:54.021 127.0.0.1:54321       18160  main      INFO: Machine physical memory: 16.00 GB
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: X-h2o-cluster-id: 1467205853154
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: User name: 'Fan'
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: awdl0 (awdl0), fe80:0:0:0:40bf:6fff:fe9c:f5c5%awdl0
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: en0 (en0), fe80:0:0:0:82e6:50ff:fe12:3dd2%en0
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: en0 (en0), 192.168.0.103
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: lo0 (lo0), fe80:0:0:0:0:0:0:1%lo0
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: lo0 (lo0), 0:0:0:0:0:0:0:1
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: lo0 (lo0), 127.0.0.55
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: lo0 (lo0), 127.0.0.54
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: lo0 (lo0), 127.0.0.53
06-29 21:10:54.022 127.0.0.1:54321       18160  main      INFO: Possible IP Address: lo0 (lo0), 127.0.0.1
06-29 21:10:54.022 127.0.0.1:54321       18160  main      FATAL: On /127.0.0.1 some of the required ports 54321, 54322 are not available, change -port PORT and try again. 
[1] "localhost"
[1] 54321
[1] TRUE
[1] -1
[1] "Could not resolve host: localhost"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: localhost
[1] 6
Error in h2o.init() : H2O failed to start, stopping execution.

我在互联网上搜索过,当java不是32位或防火墙开启时,类似的问题大多发生。所有这些都不是这里的原因。

如果你们能提供一些线索,那将是很棒的。仅供参考,我在MacOS上运行R3.3.1。但是我尝试过以前版本的R,也没用。在此先感谢您的帮助。

1 个答案:

答案 0 :(得分:5)

有些东西已经在侦听端口54321和/或54322.(或者你可能有一个非常严密的防火墙配置阻止H2O服务器声称这些端口。)

我首先尝试消除任何防火墙问题。然后,如果你确定不是它,你可以尝试明确地给出ip和/或端口:

h2o.init(nthreads = -1, max_mem_size = '2g', ip = "127.0.0.1", port = 54321)

如果可行,可能是由于你正在使用的ipv6地址。

但如果仍然没有运气,请尝试另一个端口:

h2o.init(nthreads = -1, max_mem_size = '2g', ip = "127.0.0.1", port = 50001)