0

我有一个使用 Cassandra 的小型 Rexster/Titan 集群。Rexster 扩展用于查询图形。我做了一些基准测试,并多次启动和停止 Rexster/Titan。但是现在我遇到了一个奇怪的问题: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 JAR 放在extRexster 拒绝启动的文件夹中时。

# 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 启动。

4

1 回答 1

0

日志消息无需担心。在另一个项目中逐步重建应用程序后,Rexster 现在可以从扩展开始。在此重建期间,我注意到两种情况,这可能导致所描述的行为:

缺少依赖

如果您的项目依赖于第二个项目,您可以使用 Maven 将其作为依赖项注入。但是,如果您使用

mvn clean package

要构建扩展的 JAR 文件,默认情况下它不包含此依赖项。您需要使用 Maven 插件(例如maven-shade-plugin)来创建一个包含扩展所需的所有依赖项的着色 JAR。provided将所有 Titan/Rexster/Blueprints 相关依赖项的依赖范围设置为。使用带阴影的 uber-JAR 将扩展部署到 Rexster。

但是,这对我来说并不新鲜,也不应该在我的情况下造成问题。可能有更多的情况会导致这个问题,或者可能是 Maven 的问题弄乱了阴影 JAR。随意浏览github 上的提交来捕捉这个巫术。

缺少扩展名

此行为的另一个原因是缺少扩展名。如果您在com.tinkerpop.rexster.extension.RexsterExtension资源文件中指定了启动时不存在的扩展名,则 Rexster 既不会记录也不会引发异常,但会拒绝启动。

于 2015-02-11T09:59:00.577 回答