我有一个0.5.0
带有 8 个节点的小型 Titan 集群。每个节点都在 Rexster2.5.0
和 Cassandra 中运行 Titan。它们都配置相同。不幸的是,几乎所有时间他们中的一个都无法启动。
在大多数情况下,这是种子节点之一。
使用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 扩展中创建了索引。我认为这段代码被多次调用:当我同时启动多个节点时,似乎其中一些节点试图创建索引。
问题:扩展有什么方法可以安全地创建索引?我为此创建了一个单独的线程:创建索引的方法是什么?
我将存储超时增加到 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
因为已经有一个键空间“泰坦”。或者它是一个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)
一次启动多个节点是不可能的,它们会冲突吗?这是我能想到的唯一原因,因为我可以得到任何异常,有时它工作正常。