Ara*_*ngh 5 graph-databases janusgraph
我正在关注这个博客:https : //developer.ibm.com/dwblog/2018/janusgraph-composite-mixed-indexes-traversals/
代码:
gremlin> graph.tx().rollback()
==>null
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@19472803
gremlin> code = mgmt.getPropertyKey('code')
==>code
gremlin> mgmt.buildIndex('byCodeComposite', Vertex.class).addKey(code).buildCompositeIndex()
==>byCodeComposite
gremlin> mgmt.commit()
==>null
gremlin> mgmt.awaitGraphIndexStatus(graph, 'byCodeComposite').call()
==>GraphIndexStatusReport[success=False, indexName='byCodeComposite', targetStatus=[REGISTERED], notConverged={}, converged={code=REGISTERED}, elapsed=PT0.012S]
Run Code Online (Sandbox Code Playgroud)
错误:
But i am getting this:
==>GraphIndexStatusReport[success=false, indexName='byCodeComposite', targetStatus=[REGISTERED], notConverged={code=INSTALLED}, converged={}, elapsed=PT1M0.413S]
版本:Cassandra:3.11.3 elasticsearch:6.5.4 janusgraph:0.3.1-hadoop2
我正在尝试解决这个问题,但它对我不起作用。
小智 9
抱歉,您在关注博客时遇到问题。
我注意到的一件事可能不会导致此错误,但可能会导致其他问题是您使用的 Cassandra 和 ES 版本不在0.3.1的兼容性矩阵中。
除此之外,这里有一些我去年写的索引故障排除技巧,但从未发表过。希望它有助于解决您的问题。也许我会在不久的将来有时间发布文章的其余部分。
故障排除索引:
创建索引时,如果有任何陈旧的管理会话或打开的事务,它们的索引可能会卡在 INSTALLED 状态。如果您不熟悉 JanusGraph 索引的生命周期,可以使用JanusGraph wiki 页面来绘制索引状态和生命周期图
gremlin> graph.getOpenTransactions()
==>standardjanusgraphtx[0x14ba9376]
==>standardjanusgraphtx[0x477aaf55]
Run Code Online (Sandbox Code Playgroud)
要回滚所有事务,您可以运行以下命令,直到它们全部回滚,或者您可以编写一个循环来运行它正确的次数。我个人更喜欢按下并输入几次而不是额外的打字。
graph.getOpenTransactions().getAt(0).rollback()
Run Code Online (Sandbox Code Playgroud)
要查看是否有任何陈旧的管理实例,您可以运行 getOpenInstances() 方法。这也记录在JanusGraph 文档的故障和恢复部分。如果您看到多个管理实例打开,您可以使用 forceCloseInstance 方法,如下所示。
gremlin> mgmt = graph.openManagement()
gremlin> mgmt.getOpenInstances()
==>0934f2eb69223-Chriss-MacBook-Pro-2-local2
==>0729845962091-remoteMachine1
gremlin> mgmt.forceCloseInstance('0729845962091-remoteMachine1')
gremlin> mgmt.commit()
Run Code Online (Sandbox Code Playgroud)