1

我们在一个有 5 个节点的集群中使用 OrientDB,上面有 Java API 库。他们都使用 2.2.8 版,我们使用的是 Tinkerpop Blueprints 2.6.0 版。我们遇到了一个奇怪的问题,数据库在一段时间内运行良好,然后我们突然开始遇到以下错误。自从我们从 1.7 升级到 2.2 后,我们才开始遇到这个问题。

我想知道之前是否有其他人遇到过此问题/错误,或者是否有人对我们可能需要更改哪些内容以使多节点环境正常工作有任何建议。

com.orientechnologies.orient.server.distributed.ODistributedConfigurationChangedException: Local node 'aNode' is not the master for cluster 'aCluster' (it is 'anotherNode')
    DB name="dbName"
    DB name="dbName"
    at sun.reflect.GeneratedConstructorAccessor61.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:428)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:379)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:261)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:153)
    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2133)
    at com.orientechnologies.orient.client.remote.OStorageRemote$28.execute(OStorageRemote.java:1316)
    at com.orientechnologies.orient.client.remote.OStorageRemote$28.execute(OStorageRemote.java:1289)
    at com.orientechnologies.orient.client.remote.OStorageRemote$2.execute(OStorageRemote.java:198)
    at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:230)
    at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperation(OStorageRemote.java:195)
    at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:1289)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:560)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:106)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2733)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2703)
    at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.commit(OrientTransactionalGraph.java:175)
4

1 回答 1

0

我在两节点场景中看到了类似的东西。在 node1 上保存文档(Java API)时,出现错误:

com.orientechnologies.orient.server.distributed.ODistributedConfigurationChangedException: Local node 'node1' is not the master for cluster 'event_3' (it is 'node2')
    DB name="********"
    DB name="********"
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:428)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:379)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:261)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:153)
    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2133)
    at com.orientechnologies.orient.client.remote.OStorageRemote$6.execute(OStorageRemote.java:543)
    at com.orientechnologies.orient.client.remote.OStorageRemote$6.execute(OStorageRemote.java:537)
    at com.orientechnologies.orient.client.remote.OStorageRemote$1.execute(OStorageRemote.java:166)
    at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:230)
    at com.orientechnologies.orient.client.remote.OStorageRemote.asyncNetworkOperation(OStorageRemote.java:158)
    at com.orientechnologies.orient.client.remote.OStorageRemote.createRecord(OStorageRemote.java:523)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:2075)
    at com.orientechnologies.orient.core.tx.OTransactionNoTx.saveNew(OTransactionNoTx.java:246)
    at com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:179)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2598)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:103)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1800)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1791)
    (... stack trace truncated here ...)

抛出异常的Java代码:

    OPartitionedDatabasePool pool = new OPartitionedDatabasePool(dbUrl, user, password);
    ...
    try (ODatabaseDocumentTx ignored = pool.acquire()) {
        ODocument document = new ODocument(className);
        document.fromJSON(recordData.encode());
        document.field("date", timestamp, OType.DATETIME);
        document.save();
    }

列出集群显示集群 'event_3' 确实由 node2 拥有:

|#   |NAME        |  ID|CLASS     |CONFLICT-STRATEGY|COUNT|OWNER_SERVER|OTHER_SERVERS|AUTO_DEPLOY_NEW_NODE|
|14  |event_1     |  18|event     |                 |    1|  node1     |  [node2]    |        true        |
|15  |event_2     |  19|event     |                 |    1|  node1     |  [node2]    |        true        |
|16  |event_3     |  20|event     |                 |    0|  node2     |  [node1]    |        true        |

在其他情况下插入成功,因此看起来仅在某些情况下选择了错误的节点进行插入。

于 2016-09-30T15:21:42.190 回答