2014-09-12 115 views
1

我試圖獲取在Azure上設置的Couchbase的新實例,並且無法從.net SDK進行連接。從.net訪問Couchbase Azure Windows 2012 VM

這裏的設置,我按照步驟: http://blog.couchbase.com/step-step-production-deployment-couchbase-windows-azure-virtual-machines(花了多次嘗試獲取這件事和蔚藍的虛擬網絡上運行)

已安裝版本:2.5.1企業版(建設 - 1083)上Windows Server 2012 R2。

我只運行一個虛擬機開始。中等大小,除了沙發底外什麼也沒有。

已經在機器本身和天藍色的雲服務上打開了天藍色的端口。根據此文檔在虛擬機防火牆上設置了新的入站規則:http://docs.couchbase.com/couchbase-manual-2.0/#network-ports。在Azure雲服務上,我從該文檔(8091,8092,11210,11211)打開了標記爲'node to client'的任何內容。

在瀏覽器中一切似乎都很好。在我的開發機器上,我可以從Azure VM外部IP加載couchbase。我已登錄並將testdoc添加到「默認」存儲區。我可以在瀏覽器中查看這個文檔,並且看起來不錯。

問題是當我開始嘗試從.net應用程序訪問。當我嘗試執行.Execute獲取testdoc時,出現'Unable to locate node'消息,並且生成的doc爲空。

日誌告訴我地址​​正常,但在System.Dns.GetAddrInfo(String name)處有錯誤。下面是完整的記錄多達錯誤:

2014-09-12 14:40:58,291 [10] DEBUG Couchbase.CouchbasePool [(null)] <(null)> - Initializing Couchbase.CouchbasePool 

2014-09-12 14:40:58,345 [10] WARN Enyim.Caching.MemcachedClient [(null)] <(null)> - Creating new client. CID: ffcc1454-1146-4fac-94b6-c74dae07ca4b CouchbaseClient 

2014-09-12 14:40:58,348 [10] WARN Couchbase.CouchbasePool [(null)] <(null)> - Starting Couchbase.CouchbasePool 

2014-09-12 14:40:58,468 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Starting the listener. Queue=True 

2014-09-12 14:40:58,485 [3] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Started working. 

2014-09-12 14:40:58,518 [3] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Looking for the first working node. 

2014-09-12 14:40:58,621 [3] DEBUG Couchbase.ConfigHelper [(null)] <(null)> - Found config for bucket default. 

2014-09-12 14:40:58,622 [3] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Resolved pool url http://xx.xxx.xx.xxx:8091/pools to http://xx.xxx.xx.xxx:8091/pools/default/bucketsStreaming/default?bucket_uuid=d679672b019cff2053f507a2f4fd642a 

2014-09-12 14:40:58,622 [3] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Start receiving messages. 

2014-09-12 14:40:58,661 [3] INFO Couchbase.CouchbasePool [(null)] <(null)> - Received new configuration. 

2014-09-12 14:40:58,717 [cbp_thread] INFO Couchbase.CouchbasePool [(null)] <(null)> - Has vbucket. Server count: 1 

2014-09-12 14:40:58,803 [cbp_thread] ERROR Couchbase.CouchbasePool [(null)] <(null)> - Failed to initialize the pool. 
System.Net.Sockets.SocketException (0x80004005): The requested name is valid, but no data of the requested type was found 
at System.Net.Dns.GetAddrInfo(String name) 
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) 
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) 
at Couchbase.CouchbasePool.GetFirstAddress(String hostname) 
at Couchbase.CouchbasePool.InitVBucket(ClusterConfig config, ISaslAuthenticationProvider auth) 
at Couchbase.CouchbasePool.ReconfigurePool(ClusterConfig config) 

我懷疑,因爲錯誤是DNS相關的,是我搞砸了的東西在CB機的配置,但我沒有運氣搞清楚出什麼。有任何想法嗎?

+0

是否配置了IP地址或主機名的集羣? 如果是IP地址,它們是私人或公共IP地址。 – Paddy 2014-09-12 23:15:02

+0

使用內部主機名稱,並將其映射到hosts文件中的內部IP。我希望在生產中將其他機器放置在子網上,並且能夠使用公共IP/url在我的開發機器(而不是子網)上開發/測試它。 – brettman 2014-09-13 08:39:23

+1

得到它解決。必須將客戶端機器放在同一虛擬網絡上,調整主機文件,最後,將.net app.config更改爲使用與安裝時相同的主機名稱作爲couchbase。 更詳細的位置:http://www.couchbase.com/communities/q-and-a/access-couchbase-azure-windows-2012-vm-net#node-3812 – brettman 2014-09-14 23:47:08

回答