Reputation: 825
I tried starting titan with cassandra (linux):
TitanFactory.Builder config = TitanFactory.build();
config.set("storage.backend", "embeddedcassandra");
config.set("storage.directory", DIRECTORY);
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();
Getting the following log:
09:57:50.195 [main] ERROR o.a.c.config.DatabaseDescriptor - Fatal configuration error org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Please prefix the file with file:/// for local files or file:/// for remote files. Aborting. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration. at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:73) ~[cassandra-all-2.1.9.jar:2.1.9] at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:84) ~[cassandra-all-2.1.9.jar:2.1.9] at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:161) ~[cassandra-all-2.1.9.jar:2.1.9] at org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:136) ~[cassandra-all-2.1.9.jar:2.1.9] at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:164) [cassandra-all-2.1.9.jar:2.1.9] at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:537) [cassandra-all-2.1.9.jar:2.1.9] at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:626) [cassandra-all-2.1.9.jar:2.1.9] at com.thinkaurelius.titan.diskstorage.cassandra.utils.CassandraDaemonWrapper.start(CassandraDaemonWrapper.java:75) [titan-cassandra-1.0.0.jar:na] at com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraEmbeddedStoreManager.(CassandraEmbeddedStoreManager.java:81) [titan-cassandra-1.0.0.jar:na] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.8.0_112] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [na:1.8.0_112] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_112] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [na:1.8.0_112] at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44) [titan-core-1.0.0.jar:na] at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473) [titan-core-1.0.0.jar:na] at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:407) [titan-core-1.0.0.jar:na] at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.(GraphDatabaseConfiguration.java:1320) [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:68) [main/:na] at main.java.com.bag.server.TestServer.(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]
Upvotes: 1
Views: 539
Reputation: 6853
Embedded Cassandra requires you to specify where it can find its configuration file (cassandra.yaml). From the documentation:
When running Titan in embedded mode, the Cassandra yaml file is configured using the additional configuration option storage.conf-file, which specifies the yaml file as a full url, e.g. storage.conf-file = file:///home/cassandra.yaml.
Depending on what you are trying to achieve and as you are anyways not running fully in-memory (Elasticsearch) you might consider to use berkeleyje
as your storage backend. Berkeley DB for Titan is essentially zero config. All you need is to do is specify the storage directory. E.g.
storage.backend=berkeleyje
storage.directory=${java.io.tmpdir}/${storage.dir}
Of course you are free to place the storage directory wherever you like.
The index backend is independent of the persistence backend and requires its own configuration, depending on wich backend you choose. Again, depending on what you are trying to achieve you could start without. Indexes for equality comparisons are natively supported by Titan, you do not need an external search index for that. Beware of this open Titan issue. The search index is not guaranteed to be in sync with the graph at all times.
Upvotes: 4