gpt4 book ai didi

graph-databases - 如何启动Titan图形服务器并与gremlin连接?

转载 作者:行者123 更新时间:2023-12-03 11:43:26 25 4
gpt4 key购买 nike

我已经和Titan graph server玩了一段时间了。我的感觉是,尽管有大量的文档,但缺少从头开始教程。

我的最终目标是在cassandra上运行titan,并使用StartTheShift/thunderdome查询。

我见过几种启动泰坦的方法:

使用Rexster

this link,我可以通过以下步骤运行一个titan服务器:

  • 下载rexster-server 2.3
  • 下载titan 0.3.0
  • 将所有文件从titan-all-0.3.0/libs复制到rexster-server-2.3.0/ext/titan
  • 编辑rexster-server-2.3.0/rexster.xml并添加(在之间):
    <graph>
    <graph-name>geograph</graph-name>
    <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
    <graph-read-only>false</graph-read-only>
    <graph-location>/Users/vallette/projects/DATA/gdb</graph-location>
    <properties>
    <storage.backend>local</storage.backend>
    <storage.directory>/Users/vallette/projects/DATA/gdb</storage.directory>
    <buffer-size>100</buffer-size>
    </properties>
    <extensions>
    <allows>
    <allow>tp:gremlin</allow>
    </allows>
    </extensions>
    </graph>

  • 对于berkeleydb
    要么:
        <graph>
    <graph-name>geograph</graph-name>
    <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
    <graph-location></graph-location>
    <graph-read-only>false</graph-read-only>
    <properties>
    <storage.backend>cassandra</storage.backend>
    <storage.hostname>77.77.77.77</storage.hostname>
    </properties>
    <extensions>
    <allows>
    <allow>tp:gremlin</allow>
    </allows>
    </extensions>
    </graph>

    Cassandra 数据库。
  • 使用./bin/rexster.sh -s -c rexster.xml启动服务器
  • 下载rexster控制台并使用bin/rexster-console.sh运行
  • 您现在可以使用g = rexster.getGraph("geograph")连接到图形

  • 此方法的问题在于您是通过rexster而不是gremlin连接的,因此您没有自动完成功能。优点是您可以命名数据库(此处为地理)。

    将Titan服务器与cassandra一起使用
  • 使用./bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties启动服务器
  • 使用以下命令创建一个名为cassandra.local的文件
    storage.backend=cassandrathrift
    storage.hostname=127.0.0.1
  • 启动titan gremlin并连接g = TitanFactory.open("cassandra-es.local")

  • 这很好。

    将Titan服务器与BerkeleyDB一起使用

    this link:
  • 下载titan 0.3.0
  • 使用./bin/titan.sh config/titan-server-rexster.xml config/titan-server-berkeleydb.properties启动服务器
  • 启动titan gremlin:./bin/gremlin.sh
  • ,但是一旦我尝试使用g = TitanFactory.open('graph')连接到gremlin中的数据库(图形),它就会在我所在的目录中创建一个名为graph的新数据库。如果我在我的目录(已填充)所在的位置执行该数据库,则会得到:

    Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager


  • 有人可以澄清这些过程,然后告诉我我做错了什么。
    谢谢

    最佳答案

    根据文档,TitanFactory.open()可以使用配置文件的名称或目录的名称来打开或创建数据库。

    如果史蒂文所说的是正确的,那么有两种方法可以通过BerkelyDB后端连接到数据库:

  • 通过bin/titan.sh启动数据库。通过rexster控制台连接到数据库。
  • 不要使用bin/titan.sh启动数据库。请使用gremlin控制台:TitanFactory.open("database-location")。这将打开数据库。但这没有rexster服务器。除了gremlin控制台之外,其他任何东西都将无法访问数据库。
  • 关于graph-databases - 如何启动Titan图形服务器并与gremlin连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16397426/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com