我正在使用ASP.NET Core 2.0构建一个网站(仅在一个月前从1.1升级).MongoDB也由AWS上的Mongo Atlas托管.这个MongoDB实例有3个副本集,需要SSL才能连接,并且已设置可以从任何IP访问.
它在我的机器(Windows 10 x64)和AWS(Windows Server 2016)上运行良好.
我尝试在Linux机器上部署它,我使用apt dotnet-runtime-2.0.0在Ubuntu Server 16.04上安装,然后我尝试运行我的网站,并得到以下错误(出于安全原因,我隐藏了确切的服务器域名)
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "ReplicaSet", Type : "ReplicaSet", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/*****-shard-00-00-*****.mongodb.net:27017" }", EndPoint: "Unspecified/*****-shard-00-00-*****.mongodb.net:27017", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection …Run Code Online (Sandbox Code Playgroud)