【发布时间】: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