titan with es and cassandra - java.lang.IllegalArgumentException: Index is unknown or not configured: search

StackOverflow https://stackoverflow.com//questions/23057300

  •  26-12-2019
  •  | 
  •  

Question

I am using es-cassandra. I am trying to load the default graph but I get the below error. How do I fix? I am assming I have to create a ES index? if so then what index?

curl -XPUT 'http://localhost:9200/WHAT_INDEX???/'



gremlin> g = GraphOfTheGodsFactory.create('/tmp/titan')     
==>titangraph[local:/tmp/titan]
gremlin> g = TitanFactory.open('conf/titan-cassandra-es.properties')
==>titangraph[local:/home/ubuntu/conf/titan-cassandra-es.properties]
gremlin> GraphOfTheGodsFactory.load(g)
Index is unknown or not configured: search
Display stack trace? [yN] y



java.lang.IllegalArgumentException: Index is unknown or not configured: search
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:119)
    at com.thinkaurelius.titan.graphdb.database.IndexSerializer.supports(IndexSerializer.java:73)
    at com.thinkaurelius.titan.graphdb.types.StandardKeyMaker.make(StandardKeyMaker.java:149)
    at com.thinkaurelius.titan.example.GraphOfTheGodsFactory.load(GraphOfTheGodsFactory.java:52)
    at com.thinkaurelius.titan.example.GraphOfTheGodsFactory$load.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at groovysh_evaluate.run(groovysh_evaluate:56)
    at groovysh_evaluate$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at groovysh_evaluate$run.call(Unknown Source)
    at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
    at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152)
    at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
    at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
    at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
    at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:66)
    at com.thinkaurelius.titan.tinkerpop.gremlin.Console.<init>(Console.java:57)
    at com.thinkaurelius.titan.tinkerpop.gremlin.Console.<init>(Console.java:70)
    at com.thinkaurelius.titan.tinkerpop.gremlin.Console.main(Console.java:96)
Was it helpful?

Solution

Not sure I'm following what you're trying to do. You've already initialized g with

g = GraphOfTheGodsFactory.create('/tmp/titan') 

With that you've create Graph of the Gods with BerkeleyDB. Why are you then re-initializing it with cassandra?

If I first start an instance of cassandra, then execute:

gremlin> g = TitanFactory.open('conf/titan-cassandra-es.properties')
==>titangraph[cassandrathrift:127.0.0.1]
gremlin> GraphOfTheGodsFactory.load(g)
==>null

Note the difference as compared to your gremlin session:

gremlin> g = TitanFactory.open('conf/titan-cassandra-es.properties')
==>titangraph[local:/home/ubuntu/conf/titan-cassandra-es.properties]

It actually looks like it's not finding the configuration file at conf/titan-cassandra-es.properties and is then creating a BerkeleyDB instance. You will likely find a directory at: /home/ubuntu/conf/titan-cassandra-es.properties with berkeleydb data files in it. Check the location of the actual conf/titan-cassandra-es.properties and make sure it is there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top