我试图将H2O与R一起使用。
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.
我已经通过Internet进行了搜索,并且当Java不是32位或防火墙打开时,大多数情况发生了类似的问题。所有这些都不是这里的原因。
,如果你们可以提供一些线索,那就太好了。仅供参考,我在MacOS上运行R3.3.1。但是我尝试过以前的R,也无法使用。先谢谢您的帮助。
已经在端口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)