Access Couchbase on Azure Windows 2012 VM from .net

不羁岁月 提交于 2019-12-13 18:41:43

问题


I'm trying to get a new instance of Couchbase set up on Azure, and having trouble connecting from the .net SDK.

For setup, I have followed steps here: http://blog.couchbase.com/step-step-production-deployment-couchbase-windows-azure-virtual-machines (took several attempts to get this up and running on an azure virtual network)

Have installed Version: 2.5.1 enterprise edition (build-1083) on windows Server 2012 R2.

I'm running only one VM to begin with. Medium sized, serving nothing but couchbase.

Have opened azure ports both on the machine itself, and the azure cloud service. Have set new inbound rules on the VM firewall according this document: http://docs.couchbase.com/couchbase-manual-2.0/#network-ports. On the Azure cloud service, I've opened anything marked as 'node to client' from that document (8091, 8092, 11210, 11211).

Everything seems to be fine in the browser. From my dev machine, I can load couchbase from the azure VM external IP. I have logged in and added a testdoc to the 'default' bucket. I can view this document in the browser, and everthing appear good.

The problem is when I start trying to access from .net application. When I try to .ExecuteGet the testdoc, I'm getting 'Unable to locate node' message, and the resulting doc is null.

Logs are telling me that the address is ok, but there is an error at System.Dns.GetAddrInfo(String name). Here is the full log up to the error:

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)

I suspect, as the error is DNS related, that I've screwed something up on the config of the CB machine, but I've had no luck figuring out what. Any ideas?


回答1:


Got it resolved. Had to put the client machine on the same virtual network, tweak the host file, and finally, change the .net app.config to use the same host name I gave to couchbase when installing it.

more detail here: http://forums.couchbase.com/t/access-couchbase-on-azure-windows-2012-vm-from-net/1580/5



来源:https://stackoverflow.com/questions/25811551/access-couchbase-on-azure-windows-2012-vm-from-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!