'Cannot create mixed index in JanusGraph
I'm using janusgraph 0.5.2 with Cassandra and elastic search. I wanted to create mixes indices.
I followed the docs and created my script as below. Basically I'm closing all open transactions and then creating the mixed index.
size = graph.getOpenTransactions().size();
for(i=0;i<size;i++) {graph.getOpenTransactions().getAt(0).rollback()}
mgmt = graph.openManagement()
taxNoKey = mgmt.getPropertyKey('taxNo')
mgmt.buildIndex('taxNo_mixed', Vertex.class).addKey(taxNoKey).buildMixedIndex("search")
mgmt.commit()
ManagementSystem.awaitGraphIndexStatus(graph, 'taxNo_mixed').status(SchemaStatus.REGISTERED, SchemaStatus.ENABLED).call()
mgmt = graph.openManagement()
mgmt.updateIndex(mgmt.getGraphIndex("taxNo_mixed"), SchemaAction.REINDEX).get()
mgmt.commit()
After mgmt.updateIndex(mgmt.getGraphIndex("taxNo_mixed"), SchemaAction.REINDEX).get() It get the below error.
ERROR org.janusgraph.graphdb.database.management.ManagementLogger - Evicted [2@7f00010124289-ivis-SYS-7039A-I1] from cache but waiting too long for transactions to close. Stale transaction alert on: [standardjanusgraphtx[0x332460d4], standardjanusgraphtx[0x3de388c0], standardjanusgraphtx[0x39dc0ba4], standardjanusgraphtx[0x33efa7d4]] ==>org.janusgraph.diskstorage.keycolumnvalue.scan.StandardScanMetrics@3054cdd3
- My graph is not big, it contains 200k nodes and 400k edges
- I'm copy-pasting to gremlin shell? Is it ok?
- Should there be any specific settings in elastic search for creating an index?
Any help is appreciated, thanks
Solution 1:[1]
JanusGraph can also have problems creating indices when one of the instances that once opened the graph, was not properly closed. JanusGraph has the following manual procedure to force closure afterwards:
mgmt = graph.openManagement()
mgmt.getOpenInstances() //all open instances
==>7f0001016161-dunwich1(current)
==>7f0001016161-atlantis1
mgmt.forceCloseInstance('7f0001016161-atlantis1') //remove an instance
mgmt.commit()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | HadoopMarc |
