简体   繁体   中英

Unable to connect to a running H2o Server from Python [H2O.ai]

Error on connecting to H2o server running on EMR core node from master node.

import h2o
h2o.connect(url="http://IP:54321")

Error Trace

Connecting to H2O server at http://IP:54321... successful.
Traceback (most recent call last):
  File "/home/hadoop/TataCliqEMR/app/__init__.py", line 3, in <module>
    h2o.connect(ip="IP", port=54321)
  File "/usr/local/lib/python3.4/site-packages/h2o/h2o.py", line 86, in connect
    h2oconn.cluster.show_status()
  File "/usr/local/lib/python3.4/site-packages/h2o/backend/cluster.py", line 190, in show_status
    ["H2O internal security:",     self.internal_security_enabled],
  File "/usr/local/lib/python3.4/site-packages/h2o/backend/cluster.py", line 121, in internal_security_enabled
    return self._props["internal_security_enabled"]
KeyError: 'internal_security_enabled'

It's also unanswered here

The cause of this is incompatible versions of the H2O backend and client (in this case, the client is the h2o Python module). The version of the H2O backend (the Java process running on your cluster) and the Python h2o module that you are using locally must be the same.

It seems like your server (at "http://IP:54321" ) is running an older version of H2O. Since you already have an H2O cluster running that you're trying to connect to, probably the best solution is to install a different version of the h2o Python module (instead of the reverse).

If you don't know what version your server is running, then you could look at the logs, or you can try h2o.init(ip=IP) and it should return a proper "version mismatch" error which will tell you both versions.

To download a specific version of the h2o Python module, you can look in Changes.md for the release name (eg "Turing") and then go to the Download page URL. For example, if I wanted to download 3.10.4.2, I'd search for "3.10.4.2" on the Changes.md linked above, see that the release name is "Ueno". With that information, you can construct the URL for the download page for that version, eg:

http://h2o-release.s3.amazonaws.com/h2o/rel-ueno/2/index.html

Or you can figure out the exact location of the .whl file as well:

pip install http://h2o-release.s3.amazonaws.com/h2o/rel-ueno/2/Python/h2o-3.10.4.2-py2.py3-none-any.whl

Writing this response made me realize it's not trivial to find links to older releases, so I added a JIRA to fix that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM