Re: Titan to JanusGraph migration Elasticsearc| "janusgraph" index is created and used , not titan


Akshaya Rawat <akshay...@...>
 

This solutions worked for me. Commit had to be done after the force closure. 
JanusGraphManagement jMgmt = jGraph.openManagement();
Set<String> open = jMgmt.getOpenInstances();
for (String string : open) {
if (!string.endsWith("(current)")) {
jMgmt.forceCloseInstance(string);
}
jMgmt.commit();
jMgmt = jGraph.openManagement();
jMgmt.set("index.search.index-name", "titan");
jMgmt.commit();

The graph has to be initialized all over again after this since its closed after this. 
This looks to be disruptive solution though the graph is closed and has to be initialized all over again. However this only has to be done once. Once this configuration is forced, it persists. So this could be done as one time migration may be using a script and then it works then on. 

Thanks for the solution. 

Akshaya


On Wednesday, 26 April 2017 02:36:48 UTC-7, Jason Plurad wrote:
The first error message said that there were multiple open instances. In order to close them, again you must work through the management system (do not close the graph you are already connect to).

Try something like this:

mgmt = graph.openManagement()
open
= mgmt.openInstances() // returns a set of unique instance ids
for (String inst : open) { if (!inst.endsWith("(current)")) mgmt.forceCloseInstance(inst) }
mgmt
.set('index.search.index-name', 'titan')
mgmt
.commit()

On Wednesday, April 26, 2017 at 2:47:43 AM UTC-4, Akshaya Rawat wrote:
Hi Jason, 
I tried to do that. 
JanusGraphManagement janusGraphManagement=janusGraph.openManagement();
janusGraphManagement.set("index.search.index-name", "titan");
janusGraphManagement.commit();


But I got error - 
Caused by: java.lang.IllegalArgumentException: Cannot change offline config option [root.index.index-name] since multiple instances are currently open: [c0a838679548-NOIARAWA3569221, c0a8386711772-NOIARAWA3569221, c0a8386712068-NOIARAWA3569221, c0a8386712596-NOIARAWA3569221]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at org.janusgraph.graphdb.database.management.ManagementSystem$1.verifyModification(ManagementSystem.java:180)
at org.janusgraph.diskstorage.configuration.UserModifiableConfiguration.set(UserModifiableConfiguration.java:99)
at org.janusgraph.graphdb.database.management.ManagementSystem.set(ManagementSystem.java:1316)

If I close the graph, then set , I get another error - 
janusGraph.close();
JanusGraphManagement janusGraphManagement=janusGraph.openManagement();
janusGraphManagement.set("index.search.index-name", "titan");
janusGraphManagement.commit();

Caused by: java.lang.IllegalStateException: Environment is closed.
at com.sleepycat.je.Environment.getNonNullEnvImpl(Environment.java:2496)
at com.sleepycat.je.Environment.checkOpen(Environment.java:2472)
at com.sleepycat.je.Environment.openDatabase(Environment.java:643)
at org.janusgraph.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:185)
at org.janusgraph.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:48)
at org.janusgraph.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:89)
at org.janusgraph.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:38)
at org.janusgraph.diskstorage.log.kcvs.KCVSLogManager.openLog(KCVSLogManager.java:225)
at org.janusgraph.diskstorage.Backend.getSystemMgmtLog(Backend.java:337)
at org.janusgraph.graphdb.database.StandardJanusGraph.openManagement(StandardJanusGraph.java:303)


I am not sure how to move ahead. 

Thanks
Akshaya

On Tuesday, 25 April 2017 14:19:50 UTC-7, Akshaya Rawat wrote:
Hi Jason,
Thanks for quick response.
Will try this and it should work.

Thanks
Akshaya

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.