Reputation: 141
I am trying to use h2o with R. I have installed the package according to the instructions on H2o website as follows:
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")))
Then I encountered a problem when trying do the initialisation as follows:
library(h2o)
localH2O <- h2o.init(nthreads = -1, max_mem_size = '2g')
The errors are as follows:
> 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.
I have searched over the internet and similar problems are mostly take place when the java is not 32-bit or the firewall is switched on. All these are not the reasons here.
It would be great if you guys could provide some clues on it. FYI, I am running R3.3.1 on MacOS. But I have tried previous version of R, did not work either. Thanks in advance for the help.
Upvotes: 2
Views: 7740
Reputation: 28913
Something is already listening on ports 54321 and/or 54322. (Or possibly you have a very tight firewall configuration that is stopping H2O server claiming those ports.)
I'd first try and eliminate any firewall issues. Then if you're sure that isn't it, you could try giving ip and/or port explicitly:
h2o.init(nthreads = -1, max_mem_size = '2g', ip = "127.0.0.1", port = 54321)
If that works it might be due to something about the ipv6 addresses you are using.
But if still no luck, try another port:
h2o.init(nthreads = -1, max_mem_size = '2g', ip = "127.0.0.1", port = 50001)
Upvotes: 8