1

如何创建新数据库?我正在使用来自“ https://github.com/konrade/docker-rexster ”的 Rexster Docker 映像来启动并运行功能性 Rexster 服务器。它使用以下命令运行:

sudo docker.io run -i -t -P 6cced29c46a3 /bin/bash

并验证哪个端口分配给 Rexster 的必要 8182,如下所示:

sudo docker.io port <container id> 8182

我确信服务器正在运行,因为我在访问 url 时获得带有 TinkerPop 字符的网页

'http://localhost:49153'.

但我无法成功执行灯泡快速入门部分的简单示例。这是我试图执行的简单代码:

from bulbs.rexster import Graph, Config
config = Config('http://localhost:49153/graphs/dantest')
g = Graph(config)

创建 neo4j 数据库会解决我的问题吗?如果是这样,用于创建它的代码是什么?

4

1 回答 1

1

Bulbs 不会为您创建图表 - 为此,您必须配置您的 rexster.xml 以创建特定图表。

默认图形名称是emptygraph这样,这应该是开箱即用的......

>>> from bulbs.rexster import Graph, Config
>>> config = Config('http://localhost:49153/graphs/emptygraph')
>>> g = Graph(config)
于 2014-08-12T13:12:14.280 回答