2014-02-24 112 views
1

當我嘗試做以下:Couchbase ExectureStore失敗「無法找到節點」

using (var couch = new CouchbaseClient()) { 
    couch.ExecuteStore(StoreMode.Add, idList[0].Id, seralisedList[0], PersistTo.One); 
} 

我得到

System.NullReferenceException was unhandled 
    HResult=-2147467261 
    Message=Object reference not set to an instance of an object. 
    Source=Couchbase 
    StackTrace: 
     at Couchbase.CouchbasePool.Couchbase.ICouchbaseServerPool.GetVBucket(String key) 
     at Couchbase.CouchbaseClient.Observe(String key, UInt64 cas, PersistTo persistTo, ReplicateTo replicateTo, ObserveKeyState persistedKeyState, ObserveKeyState replicatedState) 
     at Couchbase.CouchbaseClient.ExecuteStore(StoreMode mode, String key, Object value, PersistTo persistTo, ReplicateTo replciateTo) 
     at Couchbase.CouchbaseClient.ExecuteStore(StoreMode mode, String key, Object value, PersistTo persistTo) 
     at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) 
     at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
     at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
     at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
     at System.Threading.ThreadHelper.ThreadStart() 

而且在檢查的CouchBaseClient.ExecuteGet("name1")的返回值,我注意到"Unable to locate node"作爲Message的GetOperationResult

  • 服務器操作系統:Ubuntu的13.10(超V)
  • Couchbase:企業2.2.0
  • .NET客戶端: 1.3.3
  • 客戶端操作系統:贏8

Web日誌: http://pastebin.com/F1v1sMWU

App.Config中

<couchbase> 
    <servers bucket="default" bucketPassword=""> 
    <add uri="http://192.168.0.48:8091/pools"/> 
    </servers> 
</couchbase> 

Couchbase log4net的日誌:

2014-02-25 09:17:01,499 [8] DEBUG Couchbase.CouchbasePool [(null)] <(null)> - Initializing Couchbase.CouchbasePool 
2014-02-25 09:17:01,530 [8] DEBUG Couchbase.CouchbasePool [(null)] <(null)> - Starting Couchbase.CouchbasePool 
2014-02-25 09:17:01,550 [8] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Starting the listener. Queue=True 
2014-02-25 09:17:01,553 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Started working. 
2014-02-25 09:17:01,558 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Looking for the first working node. 
2014-02-25 09:17:01,616 [9] DEBUG Couchbase.ConfigHelper [(null)] <(null)> - Found config for bucket default. 
2014-02-25 09:17:01,617 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Resolved pool url http://192.168.0.48:8091/pools to http://192.168.0.48:8091/pools/default/bucketsStreaming/default?bucket_uuid=d8bd12df7bd818663d0fd85a200edabf 
2014-02-25 09:17:01,617 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Start receiving messages. 
2014-02-25 09:18:01,689 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - ReadMessage failed with exception: 
System.Net.WebException: The operation has timed out 
    at System.Net.HttpWebRequest.GetResponse() 
    at Couchbase.MessageStreamListener.ReadMessages(Uri heartBeatUrl, Uri configUrl) 
    at Couchbase.MessageStreamListener.ProcessPool() 
2014-02-25 09:18:01,691 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Reached the retry limit, rethrowing. 
System.Net.WebException: The operation has timed out 
    at System.Net.HttpWebRequest.GetResponse() 
    at Couchbase.MessageStreamListener.ReadMessages(Uri heartBeatUrl, Uri configUrl) 
    at Couchbase.MessageStreamListener.ProcessPool() 
2014-02-25 09:18:01,698 [9] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Current node 'http://192.168.0.48:8091/pools/default/bucketsStreaming/default?bucket_uuid=d8bd12df7bd818663d0fd85a200edabf' has failed. 
2014-02-25 09:18:01,698 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Looking for the first working node. 
2014-02-25 09:18:01,698 [9] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Could not resolve url http://192.168.0.48:8091/pools; trying the next in the list 
2014-02-25 09:18:01,698 [9] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Could not found a working node. 
2014-02-25 09:18:01,698 [9] WARN Couchbase.MessageStreamListener [(null)] <(null)> - All nodes are dead, sleeping for a while. 
2014-02-25 09:18:01,699 [9] DEBUG Couchbase.BucketConfigListener [(null)] <(null)> - Everything failed in Couchbase.BucketConfigListener 
2014-02-25 09:18:01,699 [9] INFO Couchbase.CouchbasePool [(null)] <(null)> - Received new configuration. 
2014-02-25 09:18:01,702 [cbp_thread] INFO Couchbase.CouchbasePool [(null)] <(null)> - Config is empty, all nodes are down. 
2014-02-25 09:18:01,702 [cbp_thread] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Processing message: 
2014-02-25 09:18:01,704 [8] DEBUG Couchbase.CouchbasePool [(null)] <(null)> - this.state was null, returning null node for key 'book::19510ce5-f890-45e9-b05c-2a35f1b05a0c' 

在訪問http://192.168.0.48:8091/pools/default/bucketsStreaming/default?bucket_uuid=d8bd12df7bd818663d0fd85a200edabf沒有任何反應,直到超時。所以這似乎是根本原因。

+0

http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it –

+0

謝謝? :/我沒有寫的couchbase c#驅動程序.... – Spike

+0

你有所有需要打開的端口? http://docs.couchbase.com/couchbase-manual-2.2/#network-ports 您可能需要通過ufw打開ubuntu實例上的端口 https://help.ubuntu.com/community/UFW – scalabilitysolved

回答

0

所以「修復」就是摧毀虛擬機並重新構建它。只是卸載couchbase服務器似乎沒有辦法。

這似乎是問題是由於DHCP /沒有一個靜態IP。希望現在我已經爲虛擬機預留了DHCP租約,不會再有任何問題。 (它今天早上打破了IP地址更改。)