使用灯泡连接到 Rexster 时出现 SystemError
SystemError when connecting to Rexster with bulbs
我搭建了Titan + Cassandra + Elasticsearch + Rexster 服务器。一切都安装正确,我可以在 Gremlin 控制台中使用 "Graph of the Gods"。我从 titan.sh
脚本开始一切。
titan/bin/titan.sh status
输出:
Titan + Rexster (com.tinkerpop.rexster.Application) is running with pid 4443
Cassandra (org.apache.cassandra.service.CassandraDaemon) is running with pid 3909
Elasticsearch (org.elasticsearch.bootstrap.Elasticsearch) is running with pid 4280
如果我转到 http://localhost:8182/doghouse
,我可以看到一个名为 "graph" 的空图表。
现在我正在尝试使用灯泡包 (http://bulbflow.com/) 从 Python (3.4) 连接到 Rexster。我尝试使用的代码非常简单:
from bulbs.rexster import Graph, Config
kg = Graph(Config('http://localhost:8182/graphs/graph'))
我得到以下异常:
Traceback (most recent call last):
File "/home/iulian/PycharmProjects/pygm/py/gm/graph/__main__.py", line 194, in <module>
main(sys.argv)
File "/home/iulian/PycharmProjects/pygm/py/gm/graph/__main__.py", line 160, in main
kg = Graph(Config('http://localhost:8182/graphs/graph'))
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/graph.py", line 56, in __init__
super(Graph, self).__init__(config)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/base/graph.py", line 58, in __init__
self.vertices = self.build_proxy(Vertex)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/base/graph.py", line 124, in build_proxy
return self.factory.build_element_proxy(element_class, index_class)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/factory.py", line 19, in build_element_proxy
primary_index = self.get_index(element_class,index_class,index_name)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/factory.py", line 27, in get_index
index = index_proxy.get_or_create(index_name)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/index.py", line 80, in get_or_create
resp = self.client.get_or_create_vertex_index(index_name, index_params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 668, in get_or_create_vertex_index
resp = self.gremlin(script, params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 356, in gremlin
return self.request.post(gremlin_path, params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rest.py", line 131, in post
return self.request(POST, path, params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rest.py", line 186, in request
return self.response_class(http_resp, self.config)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 198, in __init__
self.handle_response(response)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 222, in handle_response
response_handler(http_resp)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rest.py", line 50, in server_error
raise SystemError(http_resp)
SystemError: ({'status': '500', 'server': 'grizzly/2.2.16', 'transfer-encoding': 'chunked', 'connection': 'close', 'access-control-allow-origin': '*', 'content-type': 'application/json', 'date': 'Sun, 12 Apr 2015 16:38:03 GMT'}, b'{"success":false,"api":{"description":"evaluate an ad-hoc Gremlin script for a graph.","parameters":{"rexster.showTypes":"displays the properties of the elements with their native data type (default is false)","load":"a list of \'stored procedures\' to execute prior to the \'script\' (if \'script\' is not specified then the last script in this argument will return the values","returnTotal":"when set to true, the full result set will be iterated and the results returned (default is false)","language":"the gremlin language flavor to use (default is groovy)","params":"a map of parameters to bind to the script engine","script":"the Gremlin script to be evaluated","rexster.returnKeys":"an array of element property keys to return (default is to return all element properties)","rexster.offset.start":"start index for a paged set of data to be returned","rexster.offset.end":"end index for a paged set of data to be returned"}},"message":"","error":"javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.idx() is applicable for argument types: () values: []\nPossible solutions: is(java.lang.Object), find(), any(), find(groovy.lang.Closure), any(groovy.lang.Closure), with(groovy.lang.Closure)"}')
我应该添加名为 "graph" 的图表是我在 Rexster 中找到的默认图表,我没有添加它。
所以,我有一些问题:
- 你如何用灯泡连接到 Rexster(我肯定做错了什么)?
- 如何创建新图表?
1) 尝试 bulbs.titan.Graph 而不是 bulbs.rexster.Graph - titan 和 rexster 相似,但灯泡是 titan 的特殊外壳。
2) Titan 图在 XML 配置文件中配置。寻找
<graphs>
<graph>
</graph>
</graphs>
rexster-cassandra.xml 或 rexster-cassandra-es.xml 或您正在使用的任何配置文件中的配置。
我搭建了Titan + Cassandra + Elasticsearch + Rexster 服务器。一切都安装正确,我可以在 Gremlin 控制台中使用 "Graph of the Gods"。我从 titan.sh
脚本开始一切。
titan/bin/titan.sh status
输出:
Titan + Rexster (com.tinkerpop.rexster.Application) is running with pid 4443
Cassandra (org.apache.cassandra.service.CassandraDaemon) is running with pid 3909
Elasticsearch (org.elasticsearch.bootstrap.Elasticsearch) is running with pid 4280
如果我转到 http://localhost:8182/doghouse
,我可以看到一个名为 "graph" 的空图表。
现在我正在尝试使用灯泡包 (http://bulbflow.com/) 从 Python (3.4) 连接到 Rexster。我尝试使用的代码非常简单:
from bulbs.rexster import Graph, Config
kg = Graph(Config('http://localhost:8182/graphs/graph'))
我得到以下异常:
Traceback (most recent call last):
File "/home/iulian/PycharmProjects/pygm/py/gm/graph/__main__.py", line 194, in <module>
main(sys.argv)
File "/home/iulian/PycharmProjects/pygm/py/gm/graph/__main__.py", line 160, in main
kg = Graph(Config('http://localhost:8182/graphs/graph'))
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/graph.py", line 56, in __init__
super(Graph, self).__init__(config)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/base/graph.py", line 58, in __init__
self.vertices = self.build_proxy(Vertex)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/base/graph.py", line 124, in build_proxy
return self.factory.build_element_proxy(element_class, index_class)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/factory.py", line 19, in build_element_proxy
primary_index = self.get_index(element_class,index_class,index_name)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/factory.py", line 27, in get_index
index = index_proxy.get_or_create(index_name)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/index.py", line 80, in get_or_create
resp = self.client.get_or_create_vertex_index(index_name, index_params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 668, in get_or_create_vertex_index
resp = self.gremlin(script, params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 356, in gremlin
return self.request.post(gremlin_path, params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rest.py", line 131, in post
return self.request(POST, path, params)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rest.py", line 186, in request
return self.response_class(http_resp, self.config)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 198, in __init__
self.handle_response(response)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rexster/client.py", line 222, in handle_response
response_handler(http_resp)
File "/home/iulian/py3venv/lib/python3.4/site-packages/bulbs/rest.py", line 50, in server_error
raise SystemError(http_resp)
SystemError: ({'status': '500', 'server': 'grizzly/2.2.16', 'transfer-encoding': 'chunked', 'connection': 'close', 'access-control-allow-origin': '*', 'content-type': 'application/json', 'date': 'Sun, 12 Apr 2015 16:38:03 GMT'}, b'{"success":false,"api":{"description":"evaluate an ad-hoc Gremlin script for a graph.","parameters":{"rexster.showTypes":"displays the properties of the elements with their native data type (default is false)","load":"a list of \'stored procedures\' to execute prior to the \'script\' (if \'script\' is not specified then the last script in this argument will return the values","returnTotal":"when set to true, the full result set will be iterated and the results returned (default is false)","language":"the gremlin language flavor to use (default is groovy)","params":"a map of parameters to bind to the script engine","script":"the Gremlin script to be evaluated","rexster.returnKeys":"an array of element property keys to return (default is to return all element properties)","rexster.offset.start":"start index for a paged set of data to be returned","rexster.offset.end":"end index for a paged set of data to be returned"}},"message":"","error":"javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.idx() is applicable for argument types: () values: []\nPossible solutions: is(java.lang.Object), find(), any(), find(groovy.lang.Closure), any(groovy.lang.Closure), with(groovy.lang.Closure)"}')
我应该添加名为 "graph" 的图表是我在 Rexster 中找到的默认图表,我没有添加它。
所以,我有一些问题:
- 你如何用灯泡连接到 Rexster(我肯定做错了什么)?
- 如何创建新图表?
1) 尝试 bulbs.titan.Graph 而不是 bulbs.rexster.Graph - titan 和 rexster 相似,但灯泡是 titan 的特殊外壳。
2) Titan 图在 XML 配置文件中配置。寻找
<graphs>
<graph>
</graph>
</graphs>
rexster-cassandra.xml 或 rexster-cassandra-es.xml 或您正在使用的任何配置文件中的配置。