0

一个两节点分布式 OrientDB 系统,嵌入式模式,使用 TCP-IP 进行节点发现。该类event在四个集群上分片。重新启动一个节点后,该节点上恰好有一半的插入失败并显示错误消息:

INFO Local node 'orientdb-lab-node2' is not the owner for cluster 'event_1' (it is 'orientdb-lab-node1'). Reloading distributed configuration for database 'test-db' [ODistributedStorage]

和堆栈跟踪:

com.orientechnologies.orient.server.distributed.ODistributedConfigurationChangedException: Local node 'orientdb-lab-node2' is not the owner for cluster 'event_1' (it is 'orientdb-lab-node1')
    DB name="test-db"
    DB name="test-db"
    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:437)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:388)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:270)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:162)
    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2138)
    at com.orientechnologies.orient.client.remote.OStorageRemote$6.execute(OStorageRemote.java:548)
    at com.orientechnologies.orient.client.remote.OStorageRemote$6.execute(OStorageRemote.java:542)
    at com.orientechnologies.orient.client.remote.OStorageRemote$1.execute(OStorageRemote.java:164)
    at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:235)
    at com.orientechnologies.orient.client.remote.OStorageRemote.asyncNetworkOperation(OStorageRemote.java:156)
    at com.orientechnologies.orient.client.remote.OStorageRemote.createRecord(OStorageRemote.java:528)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:2095)
    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:2597)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:103)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1802)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1793)
    at lab.orientdb.OrientDbClient.insert(OrientDbClient.java:10)
    at lab.orientdb.Main.main(Main.java:24)

这是从 node1 看集群配置的样子:

节点 1 和 2 正在运行,每个节点上 10 次插入

CLUSTERS (collections)
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|#   |NAME       |  ID|CLASS    |CONFLICT-STRATEGY|COUNT|   OWNER_SERVER   |   OTHER_SERVERS    |AUTO_DEPLOY_NEW_NODE|
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|5   |event      |  17|event    |                 |    8|orientdb-lab-node2|[orientdb-lab-node1]|        true        |
|6   |event_1    |  18|event    |                 |    3|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|7   |event_2    |  19|event    |                 |    2|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|8   |event_3    |  20|event    |                 |    7|orientdb-lab-node2|[orientdb-lab-node1]|        true        |
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|    |TOTAL      |    |         |                 |   20|                  |                    |                    |
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+

节点 2 停止

CLUSTERS (collections)
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|#   |NAME       |  ID|CLASS    |CONFLICT-STRATEGY|COUNT|   OWNER_SERVER   |   OTHER_SERVERS    |AUTO_DEPLOY_NEW_NODE|
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|5   |event      |  17|event    |                 |    8|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|6   |event_1    |  18|event    |                 |    3|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|7   |event_2    |  19|event    |                 |    2|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|8   |event_3    |  20|event    |                 |    7|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|    |TOTAL      |    |         |                 |   20|                  |                    |                    |
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+

节点2重启,5次插入成功,5次失败

CLUSTERS (collections)
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|#   |NAME       |  ID|CLASS    |CONFLICT-STRATEGY|COUNT|   OWNER_SERVER   |   OTHER_SERVERS    |AUTO_DEPLOY_NEW_NODE|
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|5   |event      |  17|event    |                 |   11|orientdb-lab-node2|[orientdb-lab-node1]|        true        |
|6   |event_1    |  18|event    |                 |    3|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|7   |event_2    |  19|event    |                 |    2|orientdb-lab-node1|[orientdb-lab-node2]|        true        |
|8   |event_3    |  20|event    |                 |    9|orientdb-lab-node2|[orientdb-lab-node1]|        true        |
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+
|    |TOTAL      |    |         |                 |   25|                  |                    |                    |
+----+-----------+----+---------+-----------------+-----+------------------+--------------------+--------------------+

任何提示或建议表示赞赏。谢谢。

4

1 回答 1

0

这个问题已经在 OrientDB 2.2.13-SNAPSHOT 上得到解决,所以应该很快在发布版本中就可以了:https ://github.com/orientechnologies/orientdb/issues/6897

于 2016-11-10T09:37:50.760 回答