使用es和cassandra的titan - java.lang.IllegalArgumentException:索引未知或未配置:搜索

时间:2014-04-14 10:05:00

标签: titan

我正在使用es-cassandra。我正在尝试加载默认图表,但我得到以下错误。我该如何解决?我在说我必须创建一个ES索引?如果是,那么什么指数?

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)

1 个答案:

答案 0 :(得分:2)

不确定我是否正在关注您要做的事情。您已使用

初始化了g
g = GraphOfTheGodsFactory.create('/tmp/titan') 

有了这个,你就可以用BerkeleyDB创建神的图形了。你为什么用cassandra重新初始化它?

如果我首先启动一个cassandra实例,那么执行:

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

注意与gremlin会话相比的差异:

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

实际上它似乎没有在conf/titan-cassandra-es.properties找到配置文件,然后创建一个BerkeleyDB实例。您可能会在/home/ubuntu/conf/titan-cassandra-es.properties找到一个目录,其中包含berkeleydb数据文件。检查实际conf/titan-cassandra-es.properties的位置并确保它在那里。