【问题标题】:How to populate Titan with example data sets?如何使用示例数据集填充 Titan?
【发布时间】:2016-03-08 20:31:53
【问题描述】:

我正在关注AWS docs,了解如何使用DynamoDB 作为存储后端运行Titan。似乎有很多方法可以查询我的图表(Gremlin CLI、Rexster 通过 JSON 和 Web UI)。我的rexster.xml configuration file 引用了一个名为“v054”的graph-name

但我实际上如何将图持久保存到存储层并更新它?

来自我的rexster.xml

<graph-name>v054</graph-name>
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location>/tmp/titan</graph-location>
<graph-read-only>false</graph-read-only>

Rexster 网络用户界面:

更新 1

要查看为存储 Titan 图而创建的 DynamoDB 表,请确保使用 -sharedDb 标志启动 DynamoDB local(请参阅文档)。 start-dynamodb-local 配置文件尚未强制执行此操作。在您的pom.xml 中将-inMemory 标志替换为-shared

    <profile>
        <id>start-dynamodb-local</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>initialize</phase>
                            <configuration>
                                <executable>java</executable>
                                <arguments>
                                    <!-- left out other arguments for brevity .. -->
                                    <argument>-sharedDb</argument>
                                </arguments>
                            </configuration>

使用-sharedDb 运行 DynamoDB Local 后,您将看到创建了以下表:

{
  "TableNames": [
    "v054_edgestore",
    "v054_graphindex",
    "v054_system_properties",
    "v054_systemlog",
    "v054_titan_ids",
    "v054_txlog"
  ]
}

更新 2

我可以通过运行step 5 in the docs 中提到的命令来获得对我的图表的引用。但是,我必须使用完全限定名称 TitanFactory.open()(见下文)。请参阅this Github issue 了解更多信息。

gremlin> conf = new BaseConfiguration()
gremlin> conf.setProperty("storage.backend", "com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager")
gremlin> conf.setProperty("storage.dynamodb.client.endpoint", "http://localhost:4567")
gremlin> conf.setProperty("index.search.backend", "elasticsearch")
gremlin> conf.setProperty("index.search.directory", "/tmp/searchindex")
gremlin> conf.setProperty("index.search.elasticsearch.client-only", "false")
gremlin> conf.setProperty("index.search.elasticsearch.local-mode", "true")
gremlin> conf.setProperty("index.search.elasticsearch.interface", "NODE")
gremlin> g = TitanFactory.open(conf)
==>javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: TitanFactory for class: Script12
gremlin> g = com.thinkaurelius.titan.core.TitanFactory.open(conf)
==>titangraph[com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager:[127.0.0.1]]

【问题讨论】:

    标签: amazon-web-services amazon-dynamodb titan gremlin rexster


    【解决方案1】:

    您发布了 Rexster Doghouse 的屏幕截图。它嵌入了一个 Gremlin Shell。单击顶部的 Gremlin 按钮,然后开始使用 Gremlin 脚本修改新图形。有关添加图形数据的 gremlin 命令示例,请参阅the project readme,有关更多示例,请参阅gremlin docs here。在创建自己的图数据时记得调用 g.commit()(不要使用 Marvel 数据集或众神图之类的示例图数据。

    【讨论】:

    • 但是我如何在 gremlin 控制台中实际引用我的 v054 图表?在控制台中评估v054 会产生MissingPropertyException。但我可以评估(并提交)另一个图表g。但是,即使在运行 g.commit() 之后,当我尝试使用 Javascript Shell 列出它们时,我也没有看到任何 DynamoDB 本地表被创建。
    • 你提到了一个好点。您需要确保 DynamoDB Local Shell 脚本请求中的区域和凭据与 Rexster 中使用的 DynamoDB Storage Backend for Titan 的选定区域和凭据相同。在启动 DynamoDB Local 时使用-shared flag 可能更容易,这样,无论您的区域/凭据设置如何,都将使用本地实例中的相同表。
    • 根据文档,标志是 -sharedDbdocs.aws.amazon.com/amazondynamodb/latest/developerguide/…
    • 对,但如果是这样的话,start-dynamodb-local 配置文件中的pom.xml 不应该也使用-sharedDB 吗?现在它只使用-inMemory。即使这样,我如何才能在 Gremlin 控制台中引用默认的 v054 Titan DB 图?
    • 我昨天将change 转为pom.xml 以使用-sharedDb
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-12
    • 1970-01-01
    • 2013-11-20
    相关资源
    最近更新 更多