【问题标题】:Rexster refuses to start with extension but does not display errorsRexster 拒绝以扩展名开始但不显示错误
【发布时间】:2015-03-24 19:44:36
【问题描述】:

我有一个使用 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 放在 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 启动。

【问题讨论】:

    标签: cassandra titan rexster


    【解决方案1】:

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

    缺少依赖

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

    mvn clean package
    

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

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

    缺少扩展

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

    【讨论】:

      猜你喜欢
      • 2015-01-20
      • 1970-01-01
      • 1970-01-01
      • 2016-08-12
      • 2011-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-06
      相关资源
      最近更新 更多