代码之家  ›  专栏  ›  技术社区  ›  Arayan Singh

无法为状态为[已安装]的索引调用更新操作[重新索引]

  •  0
  • Arayan Singh  · 技术社区  · 6 年前

    我在关注这个博客: 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

    我正在努力解决这个问题,但它对我来说不起作用。

    1 回复  |  直到 6 年前
        1
  •  0
  •   Chris Hupman    6 年前

    抱歉,您在跟踪日志时遇到问题。

    我注意到的一件事可能不会导致这个错误,但也可能导致其他问题,那就是您使用的Cassandra和ES版本不在 compatibility matrix for 0.3.1 .

    除此之外,这里还有一些关于索引的疑难解答提示,我去年写了这些索引,但从未接触过发布。希望它能帮助你解决问题。也许我会在不久的将来把文章的其余部分贴出来。

    故障排除索引:

    创建索引时,如果存在任何过时的管理会话或打开的事务,则索引可能会卡在已安装状态。如果您不熟悉Janusgraph索引的生命周期,那么 JanusGraph wiki pages that diagrams the index states and lifecycle

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

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

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

    要查看是否有任何过时的管理实例,可以运行getOpenInstances()方法。这也记录在 failure and recovery 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()