2
votes

I am trying to setup Titan (server 0.4.4) with Cassandra embedded. My environment is Windows 8.1 x64 + Cygwin. The install is in E:\titan-server-0.4.4.

I also need to be able to access this setup via Rexster.

For my configuration, I referred to https://github.com/thinkaurelius/titan/wiki/Using-Cassandra. I've modified graph configuration E:\titan-server-0.4.4\conf\rexster-cassandra-es.xml graph section to <graph> <graph-name>graph</graph-name> <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type> <graph-read-only>false</graph-read-only> <properties>
<auto-type>none</auto-type> <storage.batch-loading>true</storage.batch-loading> <storage.cassandra-config-dir>file:///E:\titan-server-0.4.4\conf\cassandra.yaml</storage.cassandra-config-dir> <storage.backend>embeddedcassandra</storage.backend> <storage.index.search.backend>elasticsearch</storage.index.search.backend> <storage.index.search.directory>../db/es</storage.index.search.directory> <storage.index.search.client-only>false</storage.index.search.client-only> <storage.index.search.local-mode>true</storage.index.search.local-mode> </properties> <extensions> <allows> <allow>tp:gremlin</allow> </allows> </extensions> </graph>

(Note

<auto-type>none</auto-type> <storage.batch-loading>true</storage.batch-loading>

these are to allow bulk insert. The whole idea of embedded Cassandra is to improve the insertion performance.)

However, when I tried starting the service with ./bin/titan.sh -v start, the start failed with:

org.apache.cassandra.exceptions.ConfigurationException: localhost/127.0.0.1:7000 is in use by another process. Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services at org.apache.cassandra.net.MessagingService.getServerSocket(MessagingService.java:439) at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:387) at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:549) at org.apache.cassandra.service.StorageService.initServer(StorageService.java:514) at org.apache.cassandra.service.StorageService.initServer(StorageService.java:411) at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:278) at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:366) at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:409) at com.thinkaurelius.titan.diskstorage.cassandra.utils.CassandraDaemonWrapper.start(CassandraDaemonWrapper.java:51) at com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraEmbeddedStoreManager.(CassandraEmbeddedStoreManager.java:102) 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:408) at com.thinkaurelius.titan.diskstorage.Backend.instantiate(Backend.java:344) at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:367) at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:311) at com.thinkaurelius.titan.diskstorage.Backend.(Backend.java:121) at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1173) at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.(StandardTitanGraph.java:75) at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:40) at com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration.configureGraphInstance(TitanGraphConfiguration.java:25) at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:119) at com.tinkerpop.rexster.config.GraphConfigurationContainer.(GraphConfigurationContainer.java:54) at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRexsterApplication.java:99) at com.tinkerpop.rexster.server.XmlRexsterApplication.(XmlRexsterApplication.java:47) at com.tinkerpop.rexster.Application.(Application.java:96) at com.tinkerpop.rexster.Application.main(Application.java:188) localhost/127.0.0.1:7000 is in use by another process. Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services

I tried mofiying the ports in "E:\titan-server-0.4.4\conf\cassandra.yaml", but after some investigation, I've realized that the port is actually taken by Cassandra itself, i.e. in this configuration, ./bin/titan.sh -v start tries to start multiple instances of Cassandra?!

I copied cassandra.yaml to cassandra2.yaml with different port settings and specified path to cassandra2.yaml in the graph configuration xml. After this, I was able to start Rexster with Titan and Cassandra embedded by running ./bin/titan.sh -v start.

However, I strongly believe that something is wrong with this setup. Besides, the system does not behave well - sometime I cannot save a graph in Rexster's (Web based) Gremlin shell by using g.commit() - the command succeeds, but nothing gets saved.

So is the right way to run Titan with Cassandra embedded? What is the configuration supposed to be?

1
The port is being used by another process.kinkajou
Sure, but that's what I just said above. That another process is also Casandra. That seems wrong. I just need a single Casandra - how to change the configuration to limit the setup to a single Casandra only?user1234883
are you using cassandra as separate intallation?kinkajou
No. I am using Cassandra that came with Titan, i.e. that came in Titan server 0.4.4 zip. I only touched configuration files. I strongly believe that ./bin/titan.sh supplied by Titan distro, starts both rexster and Cassandra.user1234883
run bin/titan.sh stop to kill all process(cassandra+titan+rexter) and bin/titan.sh start. Did you try that?kinkajou

1 Answers

4
votes

If you use Titan server via the shell or bat script, it will automatically start a Titan instance for you and attempt to connect to it over localhost. When you configured it to use Cassandra embedded, the two instances naturally conflict.

Is there a particular reason you want to use Cassandra embedded. I'd strongly encourage you to try the out-of-the-box version first. Cassandra embedded is mostly meant for low latency applications and requires a solid understanding of the JVM.

Good luck!