Reputation: 1578
I'm trying to connect to the cluster hosted on EC2 machine from R and getting the same error when trying both on Windows and Mac:
> h2o.init(ip = "<Public IP>")
Connection successful!
ERROR: Unexpected HTTP Status code: 404 Not Found (url = http://<Public IP>:54321/3/Cloud?skip_ticks=true)
Error: lexical error: invalid char in json text.
<!DOCTYPE html> <html lang="en"
(right here) ------^
http://<Public IP>:54321/
h2o.init()
also works fine in R, so the problem is only when trying to connect to remote one.I've seen the following issue marked as resolved, but it doesn't help in my case. Have anybody experienced anything similar?
UPD: The answer was very simple. It turns out that the code example given in their guide for EC2 is outdated and uses the old version of H2O. Using the most recent version (3.9.1.5555 at the moment) on EC2 machines has resolved the issue.
Upvotes: 1
Views: 1044
Reputation: 19015
To elaborate on the OP's update, when using a remote cluster:
Make sure you install the most recent version (check the S3 download page for the redirect to the release number). In the example below, this is 3.13.0.3908:
wget http://s3.amazonaws.com/h2o-release/h2o/master/3908/h2o-3.13.0.3908.zip
unzip h2o-3.13.0.3908.zip
mv h2o-3.13.0.3908 h2o
cd h2o
java -Xmx4g -jar h2o.jar
You then need to install the version of h2o-R
that corresponds to this version. (The correct version is likely not the CRAN version.) Otherwise you will get an error like:
Error in h2o.init(ip = "XXX.XX.XX.XXX", startH2O = FALSE) :
Version mismatch! H2O is running version 3.13.0.3908 but h2o-R package is version 3.10.4.6.
Install the matching h2o-R version from - http://h2o-release.s3.amazonaws.com/h2o/master/3908/index.html
So you need to note the version number H2O is running (in the above example, 3908), make sure you have previously removed any existing h2o-R
package (see here for more info), and then do:
install.packages("h2o", type="source", repos="http://h2o-release.s3.amazonaws.com/h2o/master/3908/R")
Now it should work:
library('h2o')
remoteH2O <- h2o.init(ip='XXX.XX.XX.XXX', startH2O=FALSE) # Connection successful!
Upvotes: 1