无法为状态为[INSTALLED]的索引调用更新操作[REINDEX]

时间:2019-01-21 09:34:26

标签: 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]

错误:

But i am getting this: ==>GraphIndexStatusReport[success=false, indexName='byCodeComposite', targetStatus=[REGISTERED], notConverged={code=INSTALLED}, converged={}, elapsed=PT1M0.413S]

版本: 卡桑德拉:3.11.3 elasticsearch:6.5.4 janusgraph:0.3.1-hadoop2

我正在尝试解决此问题,但它对我不起作用。

1 个答案:

答案 0 :(得分:0)

很抱歉,您在跟踪博客时遇到了麻烦。

我要注意的一件事可能不是引起此错误,而是可能引起其他问题,因为您使用的Cassandra和ES版本不在compatibility matrix for 0.3.1中。

除此之外,还有一些我去年编写的索引的故障排除提示,这些索引从未发布。希望它有助于解决您的问题。也许我会在不久的将来发布文章的其余部分。

故障排除索引:

在创建索引时,如果存在任何过时的管理会话或未完成的事务,则它们的索引可能会停留在INSTALLED状态。如果您不熟悉JanusGraph索引的生命周期,则有一个JanusGraph wiki pages that diagrams the index states and lifecycle

gremlin> graph.getOpenTransactions()
==>standardjanusgraphtx[0x14ba9376]
==>standardjanusgraphtx[0x477aaf55]

要回滚所有事务,您可以运行下面的命令,直到它们全部回滚为止,或者您可以编写一个循环以正确次数运行它。我个人更喜欢按下并输入几次,而不需要额外输入。

graph.getOpenTransactions().getAt(0).rollback()

要查看是否有任何过时的管理实例,可以运行getOpenInstances()方法。 JanusGraph文档的failure and recovery部分中也对此进行了记录。如果看到多个管理实例打开,则可以使用forceCloseInstance方法,如下所示。

gremlin> mgmt = graph.openManagement()
gremlin> mgmt.getOpenInstances()
==>0934f2eb69223-Chriss-MacBook-Pro-2-local2
==>0729845962091-remoteMachine1
gremlin> mgmt.forceCloseInstance('0729845962091-remoteMachine1') 
gremlin> mgmt.commit()