【问题标题】:Access Couchbase on Azure Windows 2012 VM from .net从 .net 访问 Azure Windows 2012 VM 上的 Couchbase
【发布时间】:2014-09-12 15:16:56
【问题描述】:

我正在尝试在 Azure 上设置一个新的 Couchbase 实例,但无法从 .net SDK 连接。

对于设置,我已按照以下步骤操作: http://blog.couchbase.com/step-step-production-deployment-couchbase-windows-azure-virtual-machines(尝试了几次才能在 azure 虚拟网络上启动并运行它)

已在 windows Server 2012 R2 上安装版本:2.5.1 企业版(build-1083)。

一开始我只运行一个虚拟机。中等大小,只提供沙发床。

已在机器本身和 azure 云服务上打开 azure 端口。已根据此文档在 VM 防火墙上设置了新的入站规则:http://docs.couchbase.com/couchbase-manual-2.0/#network-ports。在 Azure 云服务上,我从该文档(8091、8092、11210、11211)中打开了任何标记为“节点到客户端”的内容。

浏览器中的一切似乎都很好。在我的开发机器上,我可以从 azure VM 外部 IP 加载 couchbase。我已经登录并在“默认”存储桶中添加了一个测试文档。我可以在浏览器中查看此文档,一切正常。

问题是当我开始尝试从 .net 应用程序访问时。当我尝试 .ExecuteGet 测试文档时,我收到“无法定位节点”消息,并且生成的文档为空。

日志告诉我地址​​没问题,但 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 机器的配置上搞砸了一些东西,但我没有运气弄清楚是什么。有什么想法吗?

【问题讨论】:

  • 您是否为集群配置了 IP 地址或主机名?如果是 IP 地址,它们是私有 IP 地址还是公共 IP 地址。
  • 使用内部主机名,并将其映射到hosts文件中的内部IP。我这样做是希望将其他机器放在子网上的生产中,并且我将能够使用公共 IP/url 从我的开发机器(而不是子网上)对其进行开发/测试。
  • 解决了。必须将客户端计算机放在同一个虚拟网络上,调整主机文件,最后,更改 .net app.config 以使用我在安装时给 couchbase 提供的相同主机名。更多细节在这里:couchbase.com/communities/q-and-a/…
  • @brettman - 太好了。您能否将您自己的问题标记为已回答(如有必要,添加您的评论作为答案)?

标签: windows azure couchbase


【解决方案1】:

解决了。必须将客户端计算机放在同一个虚拟网络上,调整主机文件,最后,更改 .net app.config 以使用我在安装时给 couchbase 提供的相同主机名。

这里有更多细节: http://forums.couchbase.com/t/access-couchbase-on-azure-windows-2012-vm-from-net/1580/5

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-02
    • 2021-06-07
    相关资源
    最近更新 更多