Asp.net 如何将共享主机上的godaddy站点连接到amazon ec2上的mongodb?

Asp.net 如何将共享主机上的godaddy站点连接到amazon ec2上的mongodb?,asp.net,mongodb,asp.net-mvc-4,amazon-ec2,Asp.net,Mongodb,Asp.net Mvc 4,Amazon Ec2,我在godaddy共享主机上有一个ASP.NET MVC4站点,它使用mongodb作为报告系统的存储,我还实现了一个mongodb成员身份验证提供程序。我已经使用弹性IP设置了mongodb实例。该实例目前位于Win 2k12上,MongoDB作为windows服务运行。在本地,我可以看到它,ping它,在调试我的应用程序时使用它,将MongoVUE连接到它,甚至将远程桌面连接到它 然而,当我将我们的站点部署到godaddy并尝试注册一个用户时,MongoDB成员资格提供者试图将其保存到数据库

我在godaddy共享主机上有一个ASP.NET MVC4站点,它使用mongodb作为报告系统的存储,我还实现了一个mongodb成员身份验证提供程序。我已经使用弹性IP设置了mongodb实例。该实例目前位于Win 2k12上,MongoDB作为windows服务运行。在本地,我可以看到它,ping它,在调试我的应用程序时使用它,将MongoVUE连接到它,甚至将远程桌面连接到它

然而,当我将我们的站点部署到godaddy并尝试注册一个用户时,MongoDB成员资格提供者试图将其保存到数据库中,我基本上得到了一个连接超时错误。我已将错误粘贴在底部

我尝试过的事情: 1.查找godaddy站点的ip,并打开amazon安全组中的所有tcp端口以获取来自该ip的流量 2.为来自所有地址的所有流量打开所有tcp端口 3.关闭mongodb服务器上的windows防火墙 4.2和3加在一起

我想知道mvc站点是否不能离开godaddy网络,以访问AmazonEC2实例。那么,也许这更像是戈达迪阻止它的问题,而不是亚马逊

任何帮助都将不胜感激。谢谢

错误消息:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond (my ip):27017

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond (my ip):27017

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond (my ip):27017]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208
   System.Net.Sockets.Socket.Connect(EndPoint remoteEP) +120
   System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP) +70
   MongoDB.Driver.Internal.MongoConnection.Open() +158
   MongoDB.Driver.Internal.MongoConnection.SendMessage(BsonBuffer buffer, Int32 requestId) +196
   MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message) +125
   MongoDB.Driver.Operations.CommandOperation`1.Execute(MongoConnection connection) +193
   MongoDB.Driver.MongoServerInstance.RunCommandAs(MongoConnection connection, String databaseName, IMongoCommand command) +189
   MongoDB.Driver.MongoServerInstance.Ping(MongoConnection connection) +331
   MongoDB.Driver.MongoServerInstance.Connect() +371
   MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference) +222

我刚从GoDaddy那里听说,他们故意阻止共享主机帐户访问外部资源/ip。什么废话!他们故意降低产品对客户的实用性,试图迫使客户支付更昂贵的托管费用。如果有人知道一个好的Windows/.NET共享主机提供商不做这样的事情,我洗耳恭听!谢谢

是否可以检查MongoDB的命令行选项以获取值?仅供参考,您可以使用db.serverCmdLineOpts在mongo shell中检查这一点。如果您安装了最新版本的MongoDB,那么它可能只在侦听localhost 127.0.0.1。我还将尝试通过命令行从您的GoDaddy实例连接到AWS,以确认没有防火墙阻止对MongoDB端口的访问。Stennie,我可以从我的机器上很好地连接,因此我认为本地没有必要这样做,但这是一个很好的连接测试提示。至于GoDaddy,它的共享主机,所以我无法访问它们端的命令行。谢谢