2016-09-29 57 views
1

我們在具有5個節點的羣集中使用OrientDB,並在其上面有Java API庫。他們兩個都使用2.2.8版本,我們使用的是Tinkerpop Blueprints 2.6.0版本。我們遇到了一個奇怪的問題,數據庫運行良好一段時間,然後我們突然開始遇到下面的錯誤。自從我們從1.7升級到2.2後,我們纔開始遇到這個問題。orientdb本地節點不是主人

我想知道其他人是否曾經遇到過這個問題/錯誤,或者如果有人對我們可能需要更改以獲得多節點環境的任何建議有任何建議。

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) 
+0

你在做什麼手術?它是特定羣集上的保存嗎? – Lvca

+0

上一個操作是使用藍圖OrientVertex添加邊,然後在圖上調用提交。 – TomW

+0

你可以發佈default-distributed-db-config.json嗎? –

回答

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' 確實是由節點2擁有:

|# |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  | 

插入在其他情況下是成功的,所以它看起來像只在某些場合插入錯誤的節點插入。