java - Titan 节点未启动

标签 java ubuntu cassandra titan rexster

我有一个小泰坦0.5.0具有 8 个节点的集群。每个节点都在 Rexster 中运行 Titan 2.5.0和 Cassandra 。它们的配置都是相同的。不幸的是,几乎所有时候其中一个都无法启动。
在大多数情况下,这是种子节点之一。

使用cassandra作为存储后端,我在 Rexster/Titan 日志中得到以下内容。

WARN  com.tinkerpop.rexster.config.GraphConfigurationContainer - Could 
  not open global configuration com.thinkaurelius.titan.core.TitanException:
  Could not open global configuration
 at com.thinkaurelius.titan.diskstorage.Backend.
   getStandaloneGlobalConfiguration(Backend.java: 405)
...
Caused by: com.thinkaurelius.titan.diskstorage.TemporaryBackendException: 
  Temporary failure in storage backend
 at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.
   AstyanaxStoreManager.ensureColumnFamilyExists(AstyanaxStoreManager.java:446)
...
Caused by: com.netflix.astyanax.connectionpool.exceptions.BadRequestException: 
  BadRequestException: [host=192.168.0.10(192.168.0.10):9160, latency=496(496),
  attempts=1] InvalidRequestException(why:Cannot add already existing
  column family "system_properties" to keyspace "titan")
 at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(
   ThriftConverter.java:159)

Rexster 无法启动,因此未加载图表。 然而,Rexster 无法连接的 Cassandra 节点似乎没问题:nodetool将节点列为环的一部分。如果我对剩余的 Rexster 实例发出请求,一切似乎都会正常。

我在启动节点之前删除了所有数据。

我切换到cassandrathrift导致类似的异常(由TimeoutException引起的PermanentBackendException引起的相同TitanException)。 Rexster 中的存储超时为 30 秒。这可能太低了,因为我现在同时启动所有节点,但没有解释 cassandra 的问题。 .

这里出了什么问题?

编辑:

我误用了泰坦。为了不必在启动时处理索引创建(这在我的情况下经常发生),我在 Rexster 扩展中创建了索引。我认为这段代码被调用了多次:当我同时启动多个节点时,似乎其中一些节点试图创建索引。

问题:扩展程序有什么方法可以安全地创建索引吗?我为此创建了一个单独的线程:What are the methods to create indices?

我将存储超时增加到 60 秒,并在从代码中删除索引创建后重试该过程。我仍然同时启动所有节点。一个 Rexstitan 节点(种子节点 #2)再次无法启动。

Cassandra日志确实包含异常

java.lang.IllegalArgumentException: Unknown keyspace/cf pair (titan.txlog)
    at org.apache.cassandra.db.Keyspace.getColumnFamilyStore(Keyspace.java:166)
    at org.apache.cassandra.db.Keyspace.getRow(Keyspace.java:326)
    at org.apache.cassandra.db.SliceFromReadCommand.getRow(SliceFromReadCommand.java:65)
    at org.apache.cassandra.db.ReadVerbHandler.doVerb(ReadVerbHandler.java:47)
    at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:60)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

我可以在两个种子节点中看到。虽然一个种子节点上的 Rexster 似乎并不关心另一个 Rexster 实例无法启动

Caused by: com.netflix.astyanax.connectionpool.exceptions.BadRequestException: BadRequestException: [host=192.168.0.10(192.168.0.10):9160, latency=66(66), attempts=1]InvalidRequestException(why:Cannot add already existing column family "graphindex_lock_" to keyspace "titan")
    at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:159)
    at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:65)
    at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:28)
    at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$ThriftConnection.execute(ThriftSyncConnectionFactoryImpl.java:151)
    at com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl.tryOperation(AbstractExecuteWithFailoverImpl.java:119)
    at com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:338)
    at com.netflix.astyanax.thrift.ThriftClusterImpl.executeSchemaChangeOperation(ThriftClusterImpl.java:146)
    at com.netflix.astyanax.thrift.ThriftClusterImpl.internalCreateColumnFamily(ThriftClusterImpl.java:240)

rexstitan.log 。听起来与之前引发的异常非常相似。

只是为了澄清: 失败我的意思是 Rexster 已启动并且可以查询,但无法加载 Titan 图“图”。

也许我必须将大小减小到最小,以检查这是否与簇大小有关。

编辑#2:

与簇大小无关。这真的很烦人。 有时是BadRequestException上面,有时是 BadRequestException因为已经有一个键空间“titan”。 或者是 IllegalArgumentException :

2646 [main] WARN  com.tinkerpop.rexster.config.GraphConfigurationContainer -
  Database has already been initialized but not frozen
  java.lang.IllegalArgumentException: Database has already been initialized but not frozen
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:93)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1294)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:73)
    at com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration.configureGraphInstance(TitanGraphConfiguration.java:33)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:124)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.<init>(GraphConfigurationContainer.java:54)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRexsterApplication.java:99)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.<init>(XmlRexsterApplication.java:47)
    at com.tinkerpop.rexster.Application.<init>(Application.java:97)
    at com.tinkerpop.rexster.Application.main(Application.java:189)

是否不能同时启动多个节点,它们会冲突吗? 这是我能想到的唯一原因,因为我可以得到任何异常,有时它工作得很好。

最佳答案

问题是 Titan 节点同时启动。 (版本0.5.0)
一次启动的节点越多,BadRequestException 的可能性就越大,因为所有节点都会尝试同时在 Cassandra 集群中创建相同的键空间/列系列。

要解决这个问题,您必须

  1. 启动 Cassandra(所有节点一次即可)
  2. 启动单个 Titan 节点
  3. 在此节点上打开 Rexster 控制台,创建架构和索引
  4. 启动剩余的 Titan 节点

关于java - Titan 节点未启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28094341/

相关文章:

java - sqlite java查询不插入表

java - 垃圾收集行为怪异

java - 如何在 TrustStore 中处理别名

c++ - 在 C++ Ubuntu 12.04 上使用 GMP

Cassandra 节俭异常: An existing connection was forcibly closed by the remote host

java - 使用 javafx 打印日期(作为字符串) - 保持打印当前日期

file - Ubuntu命令查找给定文件名的文件

python - 尝试使用 PyFakeWebcam 时出现 IOError

apache-spark - 是否建议使用 Kafka 作为事实来源?

cassandra - CQL-在 SELECT 语句中组合两个字段