我有一个小型的Rexster/Titan集群使用Cassandra。Rexster扩展用于查询图形。我做了一些基准,并开始和停止Rexster/泰坦多次。但现在我遇到了一个奇怪的问题: Rexster拒绝启动,但没有显示任何错误消息。
我试图找出造成这种情况的原因,并将集群简化为单个节点192.168.0.4。
如果我删除扩展,Rexster将设法启动。
# 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.但是当我将扩展uber放在ext文件夹中时,Rexster拒绝启动。
# 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.如果我现在按照控制台输出的建议检查rexstitan.log,我就找不到任何错误消息。
# 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 [*:*]在我看来,唯一奇怪的条目是关于日志的条目:
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我的异常使用记录器进行调试。您可以在github:https://github.com/sebschlicht/titan-graphity-kribble/blob/master/src/main/java/de/uniko/sebschlicht/titan/extensions/GraphityExtension.java#L22上看到实例化的用法。
尽管Rexster未能启动,但控制台中显示了PID的进程,但curl未能连接到Rexster:
$ curl 192.168.0.4:8182
curl: (7) Failed to connect to 192.168.0.4 port 8182: Connection refused为什么Rexster不抛出一个异常?如何调试这种情况?
编辑:我删除了代码中的任何日志消息。我删除了启动期间可能引发的所有异常。不过,Rexster拒绝从我的扩展名开始,日志文件中唯一的提示是未识别的读取标记。我得弄清楚是什么阻止了Rexster的开始。
发布于 2015-02-11 09:59:00
日志消息没什么好担心的。在另一个项目中重新构建应用程序之后,Rexster现在能够从扩展开始。在重建过程中,我注意到了两种可能导致所描述的行为的情况:
缺失依赖
如果您的项目依赖于第二个项目,则可以使用Maven将其作为依赖项注入。但是,如果您使用
mvn clean package要构建扩展名的JAR文件,默认情况下它不包含此依赖项。您需要使用Maven插件(例如maven-shade-plugin)创建一个阴影JAR,该JAR包含扩展所需的所有依赖项。将所有Titan/Rexster/蓝图相关依赖项的依赖范围设置为provided。使用带阴影的uber-JAR将扩展部署到Rexster。
然而,这对我来说并不新鲜,也不应该在我的案件中造成这个问题。可能会有更多的情况导致这个问题,或者Maven出现了一个问题,它破坏了隐藏的JAR。请随意浏览承诺使用github来捕捉这个巫毒。
缺失延伸
造成这种行为的另一个原因是缺少扩展。如果在com.tinkerpop.rexster.extension.RexsterExtension资源文件中指定了一个在启动时不存在的扩展名,Rexster既不会记录也不会抛出异常,但拒绝启动。
https://stackoverflow.com/questions/28149386
复制相似问题