【发布时间】:2016-01-28 14:19:48
【问题描述】:
我们的系统以编程方式创建 OrientDB 数据库,并为每个客户使用一个数据库(在任何人放弃此设计之前,原因是安全性、在数据中心/区域之间移动某些客户/数据的可能性以及迁移到本地的可能性)。
这在 OrientDB 的单一模式下非常有效。但是,当数据库以分布式模式(亚马逊上的 3 台服务器)设置时。委婉地说,这种行为很奇怪。我知道文档没有说明支持此功能,但我也找不到任何说明不支持的内容。
有时数据库创建得很好,但客户端无限期锁定(在OAdaptiveLock.lock() 中)。有时需要重新启动整个集群才能使用数据库,有时,在撰写本文时,一个 OrientDB 节点在似乎与其他节点同步后自行关闭(Address[1.2.3.4]:2434 is SHUTTING_DOWN [LifecycleService] -> @ 987654324@)。错误消息由堆栈跟踪(见下文)处理。
所以,对于我的问题:
- OrientDB 是否支持以分布式模式在线创建数据库?
- 如果是这样,我做错了什么?
- 如果没有,是否有计划在未来支持此功能?
提前致谢!
./安德斯
堆栈跟踪:
2016-01-28 14:00:01:395 SEVER [infogile02] error on creating cluster 'superclassesedge_infogile02' in class 'superClassesEdge': [OHazelcastPlugin][infogile02] Error on starting distributed plugin
com.orientechnologies.orient.server.distributed.ODistributedException: com.orientechnologies.orient.server.distributed.ODistributedException: Error on creating cluster 'superclassesedge_infogile02' in class 'superClassesEdge'
at com.orientechnologies.orient.server.hazelcast.OHazelcastDistributedDatabase.configureDatabase(OHazelcastDistributedDatabase.java:241)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.installDatabaseFromNetwork(OHazelcastPlugin.java:1131)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.requestDatabase(OHazelcastPlugin.java:971)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.installDatabase(OHazelcastPlugin.java:908)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.installNewDatabases(OHazelcastPlugin.java:1468)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.startup(OHazelcastPlugin.java:185)
at com.orientechnologies.orient.server.OServer.registerPlugins(OServer.java:979)
at com.orientechnologies.orient.server.OServer.activate(OServer.java:346)
at com.orientechnologies.orient.server.OServerMain.main(OServerMain.java:41)
Caused by: com.orientechnologies.orient.server.distributed.ODistributedException: Error on creating cluster 'superclassesedge_infogile02' in class 'superClassesEdge'
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.installLocalClusterPerClass(OHazelcastPlugin.java:1631)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.installDbClustersForLocalNode(OHazelcastPlugin.java:1300)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin$2.call(OHazelcastPlugin.java:1134)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin$2.call(OHazelcastPlugin.java:1131)
at com.orientechnologies.orient.server.hazelcast.OHazelcastDistributedDatabase.configureDatabase(OHazelcastDistributedDatabase.java:239)
... 8 more
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on saving record #0:1
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:2044)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:159)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2568)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:121)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1768)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1764)
at com.orientechnologies.orient.core.metadata.schema.OSchemaShared$1.call(OSchemaShared.java:1213)
at com.orientechnologies.orient.core.db.OScenarioThreadLocal.executeAsDistributed(OScenarioThreadLocal.java:71)
at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.saveInternal(OSchemaShared.java:1208)
at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.releaseSchemaWriteLock(OSchemaShared.java:642)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.releaseSchemaWriteLock(OClassImpl.java:1824)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.releaseSchemaWriteLock(OClassImpl.java:1819)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.addCluster(OClassImpl.java:1088)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.installLocalClusterPerClass(OHazelcastPlugin.java:1624)
... 12 more
Caused by: java.lang.NullPointerException
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.endAtomicOperation(OAtomicOperationsManager.java:148)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doUpdateRecord(OAbstractPaginatedStorage.java:2046)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.updateRecord(OAbstractPaginatedStorage.java:971)
at com.orientechnologies.orient.server.distributed.ODistributedStorage.updateRecord(ODistributedStorage.java:708)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:2005)
... 25 more
2016-01-28 14:00:01:398 INFO [10.0.9.105]:2434 [orientdb] [3.5.3] Address[10.0.9.105]:2434 is SHUTTING_DOWN [LifecycleService]
2016-01-28 14:00:01:398 WARNI [10.0.9.105]:2434 [orientdb] [3.5.3] Terminating forcefully... [Node]
2016-01-28 14:00:01:399 INFO [10.0.9.105]:2434 [orientdb] [3.5.3] Shutting down connection manager... [Node]
【问题讨论】:
-
我想我也有同样的问题。我还是想不通。
-
我认为这是一个严重的 tl;dr 案例,分布式体系结构文档 (orientdb.com/docs/2.0/orientdb.wiki/…) 指出“当集群自动运行时,在多个节点上创建数据库可能会导致同步问题已创建。请先创建数据库以在分布式模式下运行”。
-
我发现了问题,但不确定是什么原因。基本上我尝试在 docker 中运行 orientdb 并分发,但它似乎没有工作。所以在我尝试在 ubuntu 中使用新的 orientdb 之后它确实有效(通过从另一台服务器复制文件夹)
-
AWS 对我们最大的吸引力在于,我们可以在需要时自动扩展我们的后端架构。让我们对 OrientDB 感兴趣的最大特点是它是分布式的、可复制的和支持 AWS,尽管它还有其他缺陷。遗憾的是,这些功能在自动缩放下不能很好地协同工作。这可能是 hazelcast 的问题,而不是 OrientDB。
标签: distributed orientdb distributed-database orientdb-2.1