简体   繁体   English

在Windows Azure上使Node.js与MongoDB一起运行时出现问题

[英]Issues getting Node.js running with MongoDB on Windows Azure

I have been struggling to do the tutorial, https://www.windowsazure.com/en-us/develop/nodejs/tutorials/web-app-with-mongodb/ , which basically makes a simple node.js application that has access to a Mongo DB. 我一直在努力完成本教程https://www.windowsazure.com/en-us/develop/nodejs/tutorials/web-app-with-mongodb/ ,该教程基本上是一个具有访问权限的简单node.js应用程序到Mongo数据库。 I keep running into the following issue when launching the program locally with the command Start-AzureEmulator: 使用命令Start-AzureEmulator在本地启动程序时,我一直遇到以下问题:

"No connection could be made because the target machine actively refused it 127.0.0.1:27017" “无法建立连接,因为目标计算机主动拒绝了127.0.0.1:27017”

I tried various ports and configurations with no success. 我尝试了各种端口和配置,但均未成功。 Oddly enough, when I run mongodb.exe, the database launches without hiccup (this is just through the command line not within the Azure Emulator). 奇怪的是,当我运行mongodb.exe时,数据库启动时不会打cup(这只是通过命令行,而不是在Azure仿真器中)。 I have also tried reinstalling all of the tools multiple times. 我也尝试过多次重新安装所有工具。 It seems I am at a loss of what to do next. 似乎我不知道下一步该怎么做。

Have any of you experienced this problem or have been able to complete this tutorial? 你们有没有遇到过这个问题,或者已经能够完成本教程?

As a side note, do any of you know any cloud providers that allow the use of sockets with node.js? 附带说明一下,你们中没有人知道任何允许在node.js中使用套接字的云提供商吗? This is one of the main reasons I am trying to use Azure. 这是我尝试使用Azure的主要原因之一。

I assume you've followed the instructions step by step and haven't modified anything yet? 我认为您已经按照说明进行了操作,还没有修改任何内容吗?

I note from the screenshot below, that the sample tries to open Mongo at 127. 255 .0.1:27017, not 127.0.0.1:27017: 我从下面的屏幕截图中注意到,该示例尝试在127. 255 .0.1:27017而非127.0.0.1:27017处打开Mongo:

Mongo和Node服务URL

I suggest checking your Azure services' URL's in case you're looking for Mongo on the wrong address. 如果您在错误的地址上查找Mongo,建议您检查Azure服务的URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM