【问题标题】:Can't connect python with titan db无法将 python 与 Titan db 连接
【发布时间】:2018-09-22 11:17:17
【问题描述】:

按照步骤配置titan srever

bin/titan.sh

Forking Cassandra...
Running `nodetool statusthrift`... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9300)... OK (connected to 127.0.0.1:9300).
Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182)... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.

服务器完美启动,但是当我使用 python 连接然后运行脚本时,出现了我在下面提到的错误

Traceback (most recent call last):
  File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 28, in <module>
    data = (execute_query("""g.V()"""))
  File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 22, in execute_query
    results = future_results.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/resultset.py", line 81, in cb
    f.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/connection.py", line 77, in _receive
    self._protocol.data_received(data, self._results)
  File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/protocol.py", line 71, in data_received
    result_set = results_dict[request_id]
KeyError: None

我正在使用的版本控制
泰坦 - 1.0.0
gremlin-python - 3.3.2
apache-tinkerpop-gremlin-server-3.3.1

【问题讨论】:

    标签: titan tinkerpop3 gremlin-server gremlinpython


    【解决方案1】:

    Titan 支持一些非常旧的 TinkerPop 版本,如果您尝试使用 gremlin-python 3.3.2,我相信您会发现其中的一些不兼容性。由于 Titan 不再受支持,我建议您升级到 JanusGraph,这是一个更新和维护的 Titan 版本。

    【讨论】:

    • 我尝试在 JanusGraph 上工作,但我没有成功连接 gremlin-python 3.3.2。所以我尝试使用 3.2.3 之类的较低版本,它完美运行我不明白问题是什么
    • 我假设您使用的是绑定到 TinkerPop 3.2.7 的 JanusGraph 0.2。 github.com/JanusGraph/janusgraph/blob/0.2/pom.xml#L68 所以为了获得最佳效果,您应该使用 gremlin-python 3.2.7。也就是说,3.2.8 也应该可以工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-14
    • 2014-09-23
    • 1970-01-01
    • 2019-07-15
    • 1970-01-01
    相关资源
    最近更新 更多