Java orientdb本地节点不是主节点

Java orientdb本地节点不是主节点,java,orientdb,orientdb2.2,Java,Orientdb,Orientdb2.2,我们在一个集群中使用OrientDB,该集群有5个节点,上面有JavaAPI库。他们都使用2.2.8版,我们使用Tinkerpop蓝图2.6.0版。我们遇到了一个奇怪的问题,数据库在一段时间内运行正常,然后突然遇到下面的错误。从1.7升级到2.2后,我们才开始遇到此问题 我想知道以前是否有其他人遇到过此问题/错误,或者是否有人对我们可能需要进行哪些更改以使多节点环境正常工作提出了建议 com.orientechnologies.orient.server.distributed.ODistrib

我们在一个集群中使用OrientDB,该集群有5个节点,上面有JavaAPI库。他们都使用2.2.8版,我们使用Tinkerpop蓝图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)

我在两节点场景中看到了类似的情况。在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        |

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

我在双节点场景中看到了类似的情况。在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        |

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

您在执行什么操作?它是在特定集群上保存的吗?前面的操作是使用Blueprints OrientVertex添加一条边,然后在图形上调用commit。您是否可以发布默认的-distributed-db-config.json?您是否可以在github上打开一个问题?引发的问题-您正在执行什么操作?它是在特定集群上保存的吗?前面的操作是使用Blueprints OrientVertex添加一条边,然后在图形上调用commit。是否可以发布默认的-distributed-db-config.json?是否可以在github上打开一个问题?引发了一个问题-