java - 无法连接到 TitanDB - 具有相同实例 ID [] 的 Titan 图已经打开。可能需要强制关机

标签 java titan gremlin

一切正常,直到关闭我的应用程序服务器后我无法连接到 TitanDB。 我的连接代码:

try {
      titanGraph = TitanFactory.build()
                   .set("storage.backend", "cassandra")
                   .set("storage.hostname", titanHostname)
                   .set("graph.unique-instance-id-suffix", 99)
                   .open();
            if(titanGraph.isOpen()) {
                LOGGER.info("Success to open Titan DB");
            }
        } catch (Exception e) {
            initError(e, "Error opening Titan DB: ");
        }

我总是得到这个异常(exception):

Caused by: com.thinkaurelius.titan.core.TitanException: A Titan graph with the same instance id [c0a838012r] is already open. Might required forced shutdown.
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:133)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
    at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:134)
    at com.ngsoft.security.auth.TitanLoginModule.connectTitanDB(TitanLoginModule.java:119)
    ... 33 more

主要问题是:

具有相同实例 ID [...] 的 Titan 图已经打开。可能需要强制关机。

重启我的电脑,cassandra 集群没有工作

最佳答案

如何从数据库中删除 session ID c0a838012r 的示例:

我们需要通过gremlin访问管理系统,删除实例并提交。

         \,,,/
         (o o)
-----oOOo-(_)-oOOo-----
gremlin> g = TitanFactory.open('../conf/titan-db.properties')
==>titangraph[cassandra:[10.20.30.11, 10.20.30.12]]
gremlin> mgmt = g.getManagementSystem()
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@c1fca2a
gremlin> mgmt.getOpenInstances()
==>c0a838019904-Yossi_c-pc1
==>c0a838012r
==>c0a838016736-Yossi_c-pc1
gremlin> mgmt.forceCloseInstance('c0a838012r')
==>null
gremlin> mgmt.commit()
==>null

关于java - 无法连接到 TitanDB - 具有相同实例 ID [] 的 Titan 图已经打开。可能需要强制关机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33632710/

相关文章:

azure - Gremlin 查询检查顶点上的边对

java - 更改 Clover 检测类的位置

java - 读取文本文件会出现访问被拒绝错误 - 也尝试授予文件夹权限

java - Spring - 在每次调用 Service/DAO 层时包含当前用户

java - 为什么即使没有无参数构造函数,我也无法序列化对象,即使它实现了 Serialized?

scala - 在 titan + cassandra DB 中使用 gremlin scala 更新边缘属性值

gremlin - tinkerpop/gremlin-python : next() vs iterate()

java - 用于有限序列生成的 AtomicInteger

elasticsearch - 使用docker启动Titan数据库时出错

java - 写入后无法从远程读取 Gremlin 数据