问题描述
TitanFactory.Builder config = TitanFactory.build();
config.set(storage.backend,berkeleyje);
config.set(storage.directory,DIRECTORY);
//config.set(\"storage.conf-file,file:////+ DIRECTORY +/cassandra/cassandra.yaml);
config.set(index。+ INDEX_NAME +.backend,elasticsearch);
config.set(index。+ INDEX_NAME +.DIRECTORY,DIRECTORY + File.separator +es);
config.set(index。+ INDEX_NAME +.elasticsearch.local-mode,true);
config.set(index。+ INDEX_NAME +.elasticsearch.client-only,false);
graph = config.open();
加载依赖关系与gradle:
编译组:'com.thinkaurelius.titan',name:'titan-all',version:'1.0.0'
我的项目目录是:
/ home / ray / IdeaProjects / BAG - 图形数据库的拜占庭容错架构/
我的巨人在这个项目目录中的文件夹TITAN
这就是我在目录变量中设置的。
仍然开始总是崩溃:
22:56:01.420 [main] DEBUG cttdbBerkeleyJEStoreManager - 打开的数据库system_properties
java.lang.Throwable:null
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:172)[titan-berkeleyje-1.0.0.jar: na]
在com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:34)[titan-berkeleyje-1.0.0.jar:n a]
在com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:76)[titan-core-1.0.0.jar:na]
在com.thinkaurelius .titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:69)[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter .openDatabase(OrderedKeyValueStoreManagerAdapter.java:25)[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.diskstorage.Backend.getStandaloneGlobalConfiguration(Backend.java:449)[titan-core- 1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration。< init>(GraphDatabaseConfiguration.java:1322)[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)[titan-core-1.0.0.jar:na]
at com.thinkaure lian.titan.core.TitanFactory.open(TitanFactory.java:84)[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.core.TitanFactory $ Builder.open(TitanFactory。 (TitanDatabaseAccess.java:56)[main /:na]在[主要/:na]中,[titan-core-1.0.0.jar:na]
在main.java.com.bag.server.database.TitanDatabaseAccess.start
在main.java.com.bag.server.TestServer。< init>(TestServer.java:105)[main /:na]
在main.java.com.bag.server.TestServer .main(TestServer.java:428)[main /:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl。 invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_112]
在java。 lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_112]
在com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)[idea_rt。 jar:na]
22:56:01.423 [main] DEBU G cttdkkOrderedKeyValueStoreAdapter - 数据库的使用的密钥长度0 system_properties
22:56:01.429 [main] DEBUG cttcuReflectiveConfigOptionLoader $ LoaderConfiguration - 默认启用的选项加载
22:56:01.431 [main] DEBUG cttcuReflectiveConfigOptionLoader - 添加首选的类加载器到配置选项加载器链:sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.431 [main] DEBUG cttcuReflectiveConfigOptionLoader - 添加线程上下文类加载器到配置选项加载器链:sun.misc.Launcher $ AppClassLoader @ 63e31ee
22:56:01.431 [main] DEBUG cttcuReflectiveConfigOptionLoader - 添加调用者类加载器到配置选项加载器链:sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.442 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager与loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.442 [main] DEBUG cttcuReflectiveConfigOptionLo ader - 位于功能类加载器sun.misc.Launcher$AppClassLoader@63e31ee;使用它进行剩余的类加载尝试
22:56:01.447 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager与所选的加载程序sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.447 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.452 [主要] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager与选定的装载程序sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.459 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载class com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.460 [main] DEBUG cttcuReflectiveConfigOptionLoader - Unable加载类com.thinkaurelius.titan.diskstorage.solr.SolrIndex与所选的加载程序sun.misc.Launcher$AppClassLoader@63e31ee
java.lang.ClassNotFoundException:com.thinkaurelius.titan.diskstorage.solr.SolrIndex
在java.net.URLClassLoader.findClass(URLClassLoader.java:381)〜[na:1.8.0_112]
在java.lang.ClassLoader.loadClass(ClassLoader.java:424)〜[na:1.8.0_112 ]
at sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:331)〜[na:1.8.0_112]
在java.lang.ClassLoader.loadClass(ClassLoader.java:357)〜 [na:1.8.0_112]
在java.lang.Class.forName0(本机方法)〜[na:1.8.0_112]
在java.lang.Class.forName(Class.java:348) 〜[na:1.8.0_112]
at com.thinkaurelius.titan.core.util.ReflectiveConfigOptionLoader.loadStandard(ReflectiveConfigOptionLoader.java:136)〜[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace.getChild(ConfigNamespace.java:68)[titan-core-1.0.0.jar:na]
在co (com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration)中的getAll(BasicConfiguration.java:80)[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration。< init>(GraphDatabaseConfiguration.java:1327)[ titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84)[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory $ Builder .open(TitanFactory.java:139)[titan-core-1.0.0.jar:na]
在main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56)[ main /:na]
在main.java.com.bag.server.TestServer。< init>(TestServer.java:105)[main /:na]
在main.java.com。 bag.server.TestSe rver.main(TestServer.java:428)[main /:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl .invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_112]
在java .lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_112]
在com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)[idea_rt .jar:na]
22:56:01.462 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog与选定的loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.463 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLogManager与选定的装载程序sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.463 [main] DEBUG cttcuReflectiveConfigOptionLoade r - 加载类com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration与所选的加载程序sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.464 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan .graphdb.database.idassigner.placement.SimpleBulkPlacementStrategy with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.465 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.graphdb.database。 idassigner.VertexIDAssigner with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.465 [main] DEBUG cttcuReflectiveConfigOptionLoader - 加载类com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager with selected loader sun.misc .Launcher $ AppClassLoader @ 63e31ee
22:56:01.465 [main] INFO cttcuReflectiveConfigOptionLoader - 加载和初始化配置类:11 OK在12次尝试中PT0.035S
22:56:01.466 [main] DEBUG cttcuReflectiveConfigOptionLoader - 添加首选的类加载器到配置选项加载器链:sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.466 [main] DEBUG cttcuReflectiveConfigOptionLoader - 添加线程上下文类加载器到配置选项加载链:sun.misc .Launcher $ AppClassLoader @ 63e31ee
22:56:01.466 [main] DEBUG cttcuReflectiveConfigOptionLoader - 添加调用者类加载器到配置选项加载器链:sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.493 [主要] DEBUG org.reflections.Reflections - 要扫描这些网址:
文件:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database / build / classes / main /
22:56:01.497 [main] DEBUG org.reflections.Reflections - 无法在url文件中扫描文件main / java / com / bag / server / TestServer.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20容错%20架构%20 for%20Graph%20数据库/构建/类/主/带扫描器TypeAnnotationsScanner
22:56:01.497 [main] DEBUG org.reflections.Reflections - 无法在url文件中扫描文件main / java / com / bag / server / TestServer.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine% 20容错%20架构%20for%20Graph%20数据库/构建/类/主/与扫描程序SubTypesScanner
22:56:01.497 [main] DEBUG org.reflections.Reflections - 无法扫描文件main / java / com / url文件中的包/服务器/ ConflictHandler.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20数据库/构建/类/主/带扫描器TypeAnnotationsScanner
22:56:01.498 [main] DEBUG org.reflections.Reflections - 无法在url文件中扫描文件main / java / com / bag / server / ConflictHandler.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine% 20容错%20架构%20for%20Graph%20数据库/构建/类/主/带扫描程序SubTypesScanner
22:56:01.502 [main] DEBUG org.reflections.Reflections - 无法扫描文件main / java / com /袋/服务器/数据库/ Neo4jDatabaseAccess。在url文件中的类:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20容错%20架构%20for%20Graph%20数据库/构建/类/主/带扫描器TypeAnnotationsScanner
22:56:01.503 [主要] DEBUG org.reflections.Reflections - 无法在url文件中扫描文件main / java / com / bag / server / database / Neo4jDatabaseAccess.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20fault-tolerant% 20架构%20for%20Graph%20数据库/构建/类/主/带扫描程序SubTypesScanner
22:56:01.506 [main] DEBUG org.reflections.Reflections - 无法扫描文件main / java / com / bag / server / url文件中的数据库/ OrientDBDatabaseAccess.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database / build / classes / main / with scanner TypeAnnotationsScanner
22: 56:01.506 [main] DEBUG org.reflections.Reflections - 无法在url文件中扫描文件main / java / com / bag / server / database / OrientDBDatabaseAccess.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine% 20fault-TOLER蚂蚁%20架构%20为%20Graph%20数据库/构建/类/主/与扫描程序SubTypesScanner
22:56:01.508 [main] DEBUG org.reflections.Reflections - 无法扫描文件main / java / com / url文件中的客户端/ TestClient.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database / build / classes / main / with scanner TypeAnnotationsScanner
22: 56:01.508 [main] DEBUG org.reflections.Reflections - 无法在url文件中扫描文件main / java / com / bag / client / TestClient.class:/ home / ray / IdeaProjects / BAG%20-%20Byzantine%20fault-容忍%20架构%20为%20Graph%20数据库/构建/类/主/与扫描程序SubTypesScanner
22:56:01.516 [main] INFO org.reflections.Reflections - 反射花费22 ms扫描1个网址,产生6个键和13个值
22:56:01.518 [main] DEBUG cttcuReflectiveConfigOptionLoader - 通过反射(0类(错误))预加载0配置选项
22:56:01.518 [main] DEBUG cttdcBasicConfigurati on - 忽略了index.search.DIRECTORY的配置条目,因为它不映射到选项
java.lang.IllegalArgumentException:命名空间中的未知配置元素[root.index]:DIRECTORY
在com.google。 common.base.Preconditions.checkArgument(Preconditions.java:145)〜[guava-18.0.jar:na]
在com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:181)〜 (Titan-core-1.0.0.jar: na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration。< init>(GraphDatabaseConfiguration.java:1327)[titan-core-1.0.0.jar:na]
at com。 thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java: 84)[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.c ore.TitanFactory $ Builder.open(TitanFactory.java:139)[titan-core-1.0.0.jar:na]
在main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess。在main.java.com.bag.server.TestServer中的[main /:na]
。< init>(TestServer.java:105)[main /:na]
在main .java.com.bag.server.TestServer.main(TestServer.java:428)[main /:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8 .0_112]
在java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_112]
在com.intellij.rt.execution.application.AppMain.main (AppMain.java:147)[idea_rt.jar:na]
22:56:01.557 [main] DEBUG cttdcBasicConfiguration - 忽略了index.search.DIRECTORY的配置条目,因为它不映射到opt ion
java.lang.IllegalArgumentException:命名空间中的未知配置元素[root.index]:DIRECTORY
com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)〜[guava- 18.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:181)〜[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80)〜[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration 。< init>(GraphDatabaseConfiguration.java:1383)[titan-core-1.0.0.jar:na]
在com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)[titan -core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84)[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory $ Builder.open(TitanFactory.java:139)[titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56)[main /:na]
在main.java.com.bag.server.TestServer。< init>( testServer.java:105)main /:na]
在main.java.com.bag.server.TestServer.main(TestServer.java:428)[main /:na]
at sun。 reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_112]
at sun .reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_112]
在java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_112]
在com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)[idea_rt.jar:na]
22:56:01.563 [main] DEBUG cttdbBerkeleyJEStoreManager - 已删除的数据库system_properties
22:56:01.613 [main] INFO cttgcGraphDatabaseConfiguration - 生成的unique-instance-id = c0a8000d21256-Laptop1
22:56:01.641 [main] INFO cttitan.diskstorage.Backend - 配置索引[search]
线程main中的异常java.lang.IllegalArgumentException:无法实例化实现:com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)
at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473)
在com.thinkaurelius.titan.diskstorage.Backend.getIndexes(Backend.java:460)
at com.thinkaurelius.titan.diskstorage.Backend。< init>(Backend.java:147)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1805)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph。< init>(StandardTitanGraph.java:123)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)
at com.thinkaurelius.titan.core.TitanFactory.open(T itanFactory.java:84)
at com.thinkaurelius.titan.core.TitanFactory $ Builder.open(TitanFactory.java:139)
at main.java.com.bag.server.database.TitanDatabaseAccess。 start(TitanDatabaseAccess.java:56)
在main.java.com.bag.server.TestServer。< init>(TestServer.java:105)
在main.java.com.bag.server .TestServer.main(TestServer.java:428)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:498)
在com.intellij.rt.execution.application .AppMain.main(AppMain.java:147)
导致:java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect。 NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces sorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
在java.lang.reflect.Constructor.newInstance(Constructor.java:423)
在com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)
... 16更多
导致:java.lang.NoSuchFieldError:LUCENE_3_6
在org .elasticsearch.Version。< clinit>(Version.java:43)
at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.checkExpectedClientVersion(ElasticSearchIndex.java:1059)
at com.thinkaurelius。 titan.diskstorage.es.ElasticSearchIndex。< init>(ElasticSearchIndex.java:186)
... 21更多
我的毕业文件:
testCompile group:'junit',name:'junit',version: '4.11'
编译文件('libs / BFT-SMaRt.jar')
编译org.neo4j:neo4j-enterprise:$ {neo4jVersion}
编译组: 'commons-codec',name:'commons-codec',version:'1.5'
compile group:'io.netty',name:'netty-all',version:'4.0.36.Final'
编译组:'com.thinkaurelius.titan',name:'titan-all',version:'1.0.0'
compile group:'com.sparsity',name:'sparkseejava',version: '5.2.0'
编译组:'com.orientechnologies',名称:'orientdb-graphdb',版本:'2.2.11'
编译组:'org.jboss.spec.javax.ws .rs',name:'jboss-jaxrs-api_2.0_spec',version:'1.0.0.Final'
compile group:'com.esotericsoftware',name:'kryo',version:'4.0.0 '
compile'com.intellij:annotations:+ @ jar'
compile group:'org.apache.tinkerpop',name:'gremlin-core',version:'3.0.0.M9-incubating '
你应该更具体的是你的Titan依赖你不要拉入意外的文物。而不是使用 titan-all
,请尝试这样:
compile group:'com.thinkaurelius.titan',name:'titan-berkeleyje',version:'1.0.0'
compile group:'com.thinkaurelius.titan',name:'titan-es',version: '1.0.0'
您不需要包含 gremlin-core
,因为它是依赖于 titan-core
,但是如果你添加它,它应该与:
compile group:'org.apache.tinkerpop',name:'gremlin-core',version:'3.0.1-incubating'
更新
您以前的失败尝试可能会创建一个存储在 DIRECTORY
下的无效图形实例。在尝试使用相同目录创建新图表之前,您必须递归删除 DIRECTORY
。
弹性搜索索引后端不使用 index.search.DIRECTORY
配置(注意情况)。这是堆栈跟踪的相关部分:
您可以阅读更多关于Titan文档的中的各种弹性搜索配置选项。
而不是Elasticsearch,请考虑使用。它的配置看起来类似于BerkeleyJE存储,并且都非常适合单机Titan。
TitanFactory.Builder config = TitanFactory.build();
config.set(storage.backend,berkeleyje);
config.set(storage.directory,DIRECTORY + File.separator +berkeleyje);
config.set(index。+ INDEX_NAME +.backend,lucene);
config.set(index。+ INDEX_NAME +.directory,DIRECTORY + File.separator +lucene);
graph = config.open();
还要更新 build.gradle
对于lucene:
编译组:'com.thinkaurelius.titan',name:'titan-berkeleyje',version:'1.0 .0'
编译组:'com.thinkaurelius.titan',name:'titan-lucene',version:'1.0.0'
我还建议尽量建立一个没有Neo4j,OrientDB,Sparksee和其他非Titan依赖项的Titan项目,以确保您有一个简单的项目,没有任何依赖冲突。
I'm using the following code to load Titan:
TitanFactory.Builder config = TitanFactory.build();
config.set("storage.backend", "berkeleyje");
config.set("storage.directory", DIRECTORY);
//config.set("storage.conf-file", "file:////" + DIRECTORY + "/cassandra/cassandra.yaml");
config.set("index." + INDEX_NAME + ".backend", "elasticsearch");
config.set("index." + INDEX_NAME + ".DIRECTORY", DIRECTORY + File.separator + "es");
config.set("index." + INDEX_NAME + ".elasticsearch.local-mode", true);
config.set("index." + INDEX_NAME + ".elasticsearch.client-only", false);
graph = config.open();
loading dependencies with gradle:
compile group: 'com.thinkaurelius.titan', name: 'titan-all', version: '1.0.0'
My project directory is:
/home/ray/IdeaProjects/BAG - Byzantine fault-tolerant Architecture for Graph database/
my titan is in this project directory in the folder "TITAN"That's what I set in the Directory variable.
Still on start it always crashes:
22:56:01.420 [main] DEBUG c.t.t.d.b.BerkeleyJEStoreManager - Opened database system_properties
java.lang.Throwable: null
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:172) [titan-berkeleyje-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.openDatabase(BerkeleyJEStoreManager.java:34) [titan-berkeleyje-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:76) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:69) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter.openDatabase(OrderedKeyValueStoreManagerAdapter.java:25) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.Backend.getStandaloneGlobalConfiguration(Backend.java:449) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1322) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.423 [main] DEBUG c.t.t.d.k.k.OrderedKeyValueStoreAdapter - Used key length 0 for database system_properties
22:56:01.429 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader$LoaderConfiguration - Option loading enabled by default
22:56:01.431 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added preferred classloader to config option loader chain: sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.431 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added thread context classloader to config option loader chain: sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.431 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added caller classloader to config option loader chain: sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.442 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager with loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.442 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Located functioning classloader sun.misc.Launcher$AppClassLoader@63e31ee; using it for remaining classload attempts
22:56:01.447 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.447 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.cassandra.AbstractCassandraStoreManager with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.452 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.459 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.460 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Unable to load class com.thinkaurelius.titan.diskstorage.solr.SolrIndex with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
java.lang.ClassNotFoundException: com.thinkaurelius.titan.diskstorage.solr.SolrIndex
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_112]
at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_112]
at com.thinkaurelius.titan.core.util.ReflectiveConfigOptionLoader.loadStandard(ReflectiveConfigOptionLoader.java:136) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace.getChild(ConfigNamespace.java:68) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:180) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1327) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.462 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.463 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLogManager with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.463 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.464 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.graphdb.database.idassigner.placement.SimpleBulkPlacementStrategy with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.465 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.graphdb.database.idassigner.VertexIDAssigner with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.465 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded class com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager with selected loader sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.465 [main] INFO c.t.t.c.u.ReflectiveConfigOptionLoader - Loaded and initialized config classes: 11 OK out of 12 attempts in PT0.035S
22:56:01.466 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added preferred classloader to config option loader chain: sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.466 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added thread context classloader to config option loader chain: sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.466 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Added caller classloader to config option loader chain: sun.misc.Launcher$AppClassLoader@63e31ee
22:56:01.493 [main] DEBUG org.reflections.Reflections - going to scan these urls:
file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/
22:56:01.497 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/TestServer.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.497 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/TestServer.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.497 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/ConflictHandler.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.498 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/ConflictHandler.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.502 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/Neo4jDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.503 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/Neo4jDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.506 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/OrientDBDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.506 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/server/database/OrientDBDatabaseAccess.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.508 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/client/TestClient.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner TypeAnnotationsScanner
22:56:01.508 [main] DEBUG org.reflections.Reflections - could not scan file main/java/com/bag/client/TestClient.class in url file:/home/ray/IdeaProjects/BAG%20-%20Byzantine%20fault-tolerant%20Architecture%20for%20Graph%20database/build/classes/main/ with scanner SubTypesScanner
22:56:01.516 [main] INFO org.reflections.Reflections - Reflections took 22 ms to scan 1 urls, producing 6 keys and 13 values
22:56:01.518 [main] DEBUG c.t.t.c.u.ReflectiveConfigOptionLoader - Preloaded 0 config option(s) via Reflections (0 class(es) with errors)
22:56:01.518 [main] DEBUG c.t.t.d.c.BasicConfiguration - Ignored configuration entry for index.search.DIRECTORY since it does not map to an option
java.lang.IllegalArgumentException: Unknown configuration element in namespace [root.index]: DIRECTORY
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:181) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1327) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.557 [main] DEBUG c.t.t.d.c.BasicConfiguration - Ignored configuration entry for index.search.DIRECTORY since it does not map to an option
java.lang.IllegalArgumentException: Unknown configuration element in namespace [root.index]: DIRECTORY
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.ConfigElement.parse(ConfigElement.java:181) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.getAll(BasicConfiguration.java:80) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1383) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84) [titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139) [titan-core-1.0.0.jar:na]
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56) [main/:na]
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105) [main/:na]
at main.java.com.bag.server.TestServer.main(TestServer.java:428) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
22:56:01.563 [main] DEBUG c.t.t.d.b.BerkeleyJEStoreManager - Removed database system_properties
22:56:01.613 [main] INFO c.t.t.g.c.GraphDatabaseConfiguration - Generated unique-instance-id=c0a8000d21256-Laptop1
22:56:01.641 [main] INFO c.t.titan.diskstorage.Backend - Configuring index [search]
Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)
at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473)
at com.thinkaurelius.titan.diskstorage.Backend.getIndexes(Backend.java:460)
at com.thinkaurelius.titan.diskstorage.Backend.<init>(Backend.java:147)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1805)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:123)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84)
at com.thinkaurelius.titan.core.TitanFactory$Builder.open(TitanFactory.java:139)
at main.java.com.bag.server.database.TitanDatabaseAccess.start(TitanDatabaseAccess.java:56)
at main.java.com.bag.server.TestServer.<init>(TestServer.java:105)
at main.java.com.bag.server.TestServer.main(TestServer.java:428)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)
... 16 more
Caused by: java.lang.NoSuchFieldError: LUCENE_3_6
at org.elasticsearch.Version.<clinit>(Version.java:43)
at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.checkExpectedClientVersion(ElasticSearchIndex.java:1059)
at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:186)
... 21 more
My gradle file:
testCompile group: 'junit', name: 'junit', version: '4.11'
compile files('libs/BFT-SMaRt.jar')
compile "org.neo4j:neo4j-enterprise:${neo4jVersion}"
compile group: 'commons-codec', name: 'commons-codec', version: '1.5'
compile group: 'io.netty', name: 'netty-all', version: '4.0.36.Final'
compile group: 'com.thinkaurelius.titan', name: 'titan-all', version: '1.0.0'
compile group: 'com.sparsity', name: 'sparkseejava', version: '5.2.0'
compile group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '2.2.11'
compile group: 'org.jboss.spec.javax.ws.rs', name: 'jboss-jaxrs-api_2.0_spec', version: '1.0.0.Final'
compile group: 'com.esotericsoftware', name: 'kryo', version: '4.0.0'
compile 'com.intellij:annotations:+@jar'
compile group: 'org.apache.tinkerpop', name: 'gremlin-core', version: '3.0.0.M9-incubating'
You should be more specific on your Titan dependencies so you don't pull in unintended artifacts. Instead of using titan-all
, try something like this:
compile group: 'com.thinkaurelius.titan', name: 'titan-berkeleyje', version: '1.0.0'
compile group: 'com.thinkaurelius.titan', name: 'titan-es', version: '1.0.0'
You should not need to include gremlin-core
explicitly because it is a dependency of titan-core
, however if you do add it, it should be aligned with the TinkerPop version that Titan 1.0 uses:
compile group: 'org.apache.tinkerpop', name: 'gremlin-core', version: '3.0.1-incubating'
Updated
Your previous failed attempts have likely created an invalid graph instance stored under DIRECTORY
. You must recursively remove DIRECTORY
before attempting to create a new graph using the same directory.
Elasticsearch indexing backend does not work with a index.search.DIRECTORY
configuration (note the case). This is the relevant part of the stack trace:
You can read more about the various Elasticsearch configuration options in Chapter 22 of the Titan documentation.
Instead of Elasticsearch, consider using Lucene. Its configuration looks similar to BerkeleyJE storage, and both are well-suited for a single-machine Titan.
TitanFactory.Builder config = TitanFactory.build();
config.set("storage.backend", "berkeleyje");
config.set("storage.directory", DIRECTORY + File.separator + "berkeleyje");
config.set("index." + INDEX_NAME + ".backend", "lucene");
config.set("index." + INDEX_NAME + ".directory", DIRECTORY + File.separator + "lucene");
graph = config.open();
Also update build.gradle
with the dependency for lucene:
compile group: 'com.thinkaurelius.titan', name: 'titan-berkeleyje', version: '1.0.0'
compile group: 'com.thinkaurelius.titan', name: 'titan-lucene', version: '1.0.0'
I'd also recommend trying to build a Titan project without Neo4j, OrientDB, Sparksee, and other non-Titan dependencies first to ensure you have a simple project that works without any dependency conflicts.
这篇关于泰坦加载弹性搜索的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!