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

可紊 提交于 2019-12-24 09:33:34

问题


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


回答1:


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 (e.g. "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, e.g:

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.



来源:https://stackoverflow.com/questions/43774821/unable-to-connect-to-a-running-h2o-server-from-python-h2o-ai

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!