0
votes

I have a small Rexster/Titan cluster using Cassandra. A Rexster extension is used to query the graph. I did some benchmarking and did start and stop Rexster/Titan many times. But now I run into a strange issue: Rexster refuses to start but does not display any error message.

I tried to figure out what is causing this and reduced the cluster to a single node 192.168.0.4.

If I remove my extension Rexster manages to start up.

# console output
Forking Cassandra...
Running `nodetool statusthrift`..... OK
(returned exit status 0 and printed string "running").
Forking Titan + Rexster...
Connecting to Titan + Rexster (127.0.0.1:8184)...... OK
(connected to 127.0.0.1:8184).
Run rexster-console.sh to connect.

but when I place my extension uber JAR in the ext folder Rexster refuses to start.

# console output
Forking Cassandra...
Running `nodetool statusthrift`..... OK
(returned exit status 0 and printed string "running").
Forking Titan + Rexster...
Connecting to Titan + Rexster (127.0.0.1:8184)............................
timeout exceeded (60 seconds): could not connect to 127.0.0.1:8184
See /var/lib/titan/bin/../log/rexstitan.log for Rexster log output.

If I now check rexstitan.log, as suggested by the console output, I can not find any error message.

# rexstitan.log
0 [main] INFO com.tinkerpop.rexster.Application  - .:Welcome to Rexster:.
73 [main] INFO com.tinkerpop.rexster.server.RexsterProperties -
  Using [/var/lib/titan/rexhome/../conf/rexster-cassandra-cluster.xml]
  as configuration source.
78 [main] INFO com.tinkerpop.rexster.Application - Rexster is watching 
  [/var/lib/titan/rexhome/../conf/rexster-cassandra-cluster.xml] for change.
244 [main] INFO com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager -
  Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,
  name=ClusterTitanConnectionPool,ServiceType=connectionpool
252 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor -
  AddHost: 192.168.0.4
537 [main] INFO com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager -
  Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,
  name=KeyspaceTitanConnectionPool,ServiceType=connectionpool
538 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor -
  AddHost: 192.168.0.4
1951 [main] INFO com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration - 
  Set cluster.partition=false from store features
1971 [main] INFO com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration -
  Set default timestamp provider MICRO
2019 [main] INFO com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration -
  Generated unique-instance-id=7f0000012902-node1
2045 [main] INFO com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager -
  Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,
  name=ClusterTitanConnectionPool,ServiceType=connectionpool
2046 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor -
  AddHost: 192.168.0.4
2053 [main] INFO com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager -
  Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,
  name=KeyspaceTitanConnectionPool,ServiceType=connectionpool
2054 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor -
  AddHost: 192.168.0.4
2228 [main] INFO  com.thinkaurelius.titan.diskstorage.Backend -
  Initiated backend operations thread pool of size 4
6619 [main] INFO  com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog -
  Loaded unidentified ReadMarker start time Timepoint[1423479705116000 μs]
  into com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog$MessagePuller@212f3ff1
6625 [main] INFO  com.tinkerpop.rexster.RexsterApplicationGraph -
  Graph [graph] - configured with allowable namespace [*:*]

The only entry that looks strange to me is the one concerning the log:

6619 [main] INFO  com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog -
  Loaded unidentified ReadMarker start time Timepoint[1423479705116000 μs]
  into com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog$MessagePuller@212f3ff1

My exception uses the logger for debugging. You can see the instantiation an usage on github: https://github.com/sebschlicht/titan-graphity-kribble/blob/master/src/main/java/de/uniko/sebschlicht/titan/extensions/GraphityExtension.java#L22

Though Rexster failed to start there is a process with the PID displayed in the console but curl fails to connect to Rexster:

$ curl 192.168.0.4:8182
curl: (7) Failed to connect to 192.168.0.4 port 8182: Connection refused

Why doesn't Rexster throw an exception? How can I debug this situation?

edit: I removed any log messages in my code. I removed all exceptions that may be thrown during startup. Still Rexster refuses to start with my extension and the only hint in the log files is the unidentified read marker. I have to clue what prevents Rexster from starting.

1

1 Answers

0
votes

The log message is nothing to worry about. After rebuilding the application in another project step-by-step Rexster is now able to start with the extension. During this rebuild I noticed two situations, that can cause the behaviour described:

Missing dependency

If your project depends on a second project you might use Maven to inject it as a dependency. However, if you use

mvn clean package

to build the extension's JAR file it does not contain this dependency by default. You need to use a Maven plugin (e.g. maven-shade-plugin) to create a shaded JAR that contains all the dependencies your extension needs. Set the dependency scope to provided for all Titan/Rexster/Blueprints related dependencies. Use the shaded uber-JAR to deploy the extension to Rexster.

However, this was not new to me and should not have caused the problem in my case. There might be more situations that cause this problem or maybe there was a problem with Maven that messed up the shaded JAR. Feel free to browse the commit on github to catch this voodoo.

Missing extension

Another cause of this behaviour is a missing extension. If you specify an extension in the com.tinkerpop.rexster.extension.RexsterExtension resource file, that is not present on startup, Rexster does neither log nor throw an exception, but refuses to start.