我在分布式模式下使用了orientdb,但我遇到了一些问题..
我尝试过版本2.0.2,2.0.4和2.1-SHAPSHOT。
使用带有Tinkerpop库的java客户端,尝试插入记录时,数据库会抛出异常:
com.orientechnologies.common.exception.OException: Cannot find best cluster for class 'MYCLASS' on server 'node1'.
我注意到的另一个错误是:
Cannot route READ_RECORD operation for #-1:-3 to the distributed node
java.lang.IllegalArgumentException: Cannot read record #-1:-3 since the position is invalid in database 'mydb'
非常感谢
修改
我注意到它有时会起作用,我想我在哪种情况下找到了:
使用dserver.sh启动第一个节点,然后使用dserver.sh运行第二个节点。
从我的java Tinkerpop客户端,如果我将连接设置为第一个节点,则无法使用“无法找到最佳群集”,但如果我将其配置为连接到第二个节点..它可以工作!
如果我在第一个节点之前启动第二个节点,我的客户端必须配置为指向第一个节点才能使其正常工作!
希望有所帮助
修改2
使用2.0.5似乎有效,但现在我在顶点删除过程中遇到了另一个问题。
orientdb {db=dmd3}> delete edge #12:4
Error: com.orientechnologies.orient.server.distributed.ODistributedException: Error on executing distributed request (id=124 from=node_2__test task=command_sql(delete edge #12:4) userName=) against database 'dmd3.[]' to nodes [node_2__test, node_1__test]
Error: com.orientechnologies.orient.server.distributed.ODistributedException: Quorum 2 not reached for request (id=124 from=node_2__test task=command_sql(delete edge #12:4) userName=). Timeout=19ms Servers in timeout/conflict are:
- node_1__test: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4
Received: {node_2__test=com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4, node_1__test=com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4}
这是orientdb日志
2015-03-16 14:35:01:981 WARNING [node_2__test] detected 1 node(s) in timeout or in conflict and quorum (2) has not been reached, rolling back changes for request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=) [ODistributedResponseManager]
2015-03-16 14:35:01:985 WARNING [node_2__test] Quorum 2 not reached for request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=). Timeout=12ms Servers in timeout/conflict are:
- node_2__test: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4
Received: {node_2__test=com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4, node_1__test=com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4} [ODistributedResponseManager]
2015-03-16 14:35:01:985 WARNING [node_2__test] sending undo message for request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=) to server node_2__test [ODistributedResponseManager]
2015-03-16 14:35:01:986 WARNING [node_2__test] sending undo message for request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=) to server node_1__test [ODistributedResponseManager]Sent run-time exception to the client /127.0.0.1:39695: com.orientechnologies.orient.server.distributed.ODistributedException: Error on executing distributed request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=) against database 'dmd3.[]' to nodes [node_2__test, node_1__test]
com.orientechnologies.orient.server.distributed.ODistributedException: Error on executing distributed request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=) against database 'dmd3.[]' to nodes [node_2__test, node_1__test]
at com.orientechnologies.orient.server.hazelcast.OHazelcastDistributedDatabase.send2Nodes(OHazelcastDistributedDatabase.java:194)
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.sendRequest(OHazelcastPlugin.java:350)
at com.orientechnologies.orient.server.distributed.ODistributedStorage.command(ODistributedStorage.java:258)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1178)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:385)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:220)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)
Caused by: com.orientechnologies.orient.server.distributed.ODistributedException: Quorum 2 not reached for request (id=126 from=node_2__test task=command_sql(delete edge #12:4) userName=). Timeout=12ms Servers in timeout/conflict are:
- node_2__test: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4
Received: {node_2__test=com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4, node_1__test=com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.delete edge #12:4}
at com.orientechnologies.orient.server.distributed.ODistributedResponseManager.manageConflicts(ODistributedResponseManager.java:576)
at com.orientechnologies.orient.server.distributed.ODistributedResponseManager.getFinalResponse(ODistributedResponseManager.java:340)
at com.orientechnologies.orient.server.hazelcast.OHazelcastDistributedDatabase.waitForResponse(OHazelcastDistributedDatabase.java:364)
at com.orientechnologies.orient.server.hazelcast.OHazelcastDistributedDatabase.send2Nodes(OHazelcastDistributedDatabase.java:191)
... 7 more