无法为状态为 [INSTALLED] 的索引调用更新操作 [REINDEX]
Update action [REINDEX] cannot be invoked for index with status [INSTALLED]
我正在关注这个博客:
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
弹性搜索:6.5.4
janusgraph: 0.3.1-hadoop2
我正在尝试解决这个问题,但它对我不起作用。
抱歉,您在关注博客时遇到问题。
我注意到一件事可能不会导致此错误,但可能会导致其他问题是您使用的 Cassandra 和 ES 的版本不在 compatibility matrix for 0.3.1 中。
除此之外,这里还有一些针对我去年写的索引的故障排除技巧,但一直没有时间发布。希望它有助于解决您的问题。也许我会在不久的将来抽空发布文章的其余部分。
故障排除索引:
创建索引时,如果有任何陈旧的管理会话或打开的 t运行它们索引的操作可能会卡在 INSTALLED 状态。如果您不熟悉 JanusGraph 索引的生命周期,那么有一个 JanusGraph wiki pages that diagrams the index states and lifecycle
gremlin> graph.getOpenTransactions()
==>standardjanusgraphtx[0x14ba9376]
==>standardjanusgraphtx[0x477aaf55]
要回滚所有 t运行 操作,您可以 运行 下面的命令,直到它们全部回滚,或者您可以编写一个循环 运行 它的正确数量次。我个人更喜欢按下并输入几次而不是额外的打字。
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()
我正在关注这个博客: 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 弹性搜索:6.5.4 janusgraph: 0.3.1-hadoop2
我正在尝试解决这个问题,但它对我不起作用。
抱歉,您在关注博客时遇到问题。
我注意到一件事可能不会导致此错误,但可能会导致其他问题是您使用的 Cassandra 和 ES 的版本不在 compatibility matrix for 0.3.1 中。
除此之外,这里还有一些针对我去年写的索引的故障排除技巧,但一直没有时间发布。希望它有助于解决您的问题。也许我会在不久的将来抽空发布文章的其余部分。
故障排除索引:
创建索引时,如果有任何陈旧的管理会话或打开的 t运行它们索引的操作可能会卡在 INSTALLED 状态。如果您不熟悉 JanusGraph 索引的生命周期,那么有一个 JanusGraph wiki pages that diagrams the index states and lifecycle
gremlin> graph.getOpenTransactions()
==>standardjanusgraphtx[0x14ba9376]
==>standardjanusgraphtx[0x477aaf55]
要回滚所有 t运行 操作,您可以 运行 下面的命令,直到它们全部回滚,或者您可以编写一个循环 运行 它的正确数量次。我个人更喜欢按下并输入几次而不是额外的打字。
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()