使用.Net mongodb驱动程序托管ubuntu 16.04 LTS时,30000ms后Atlas MongoDB发生超时

问题描述 投票:0回答:1

从本地系统.NET标准2.0与mongo驱动程序2.7.3连接到Atlas mongodb并列出更改流工作。

当我将相同的系统部署到ubuntu 16.04 LTS时,它会抛出以下错误。

连接字符串:

mongodb://xxxxxx:xxxxx@mycluster-shard-00-00- 
xxxx.mongodb.net:27017,mycluster-shard-00-01- 
xxxx.mongodb.net:27017,mycluster-shard-00-02-xxxx.mongodb.net:27017/test?ssl=true& 
replicaSet=Cluster-shard-0&retryWrites=true

错误:

             A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, 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/mycluster-shard-00-00-xxxx.mongodb.net:27017" }", EndPoint: "U
            nspecified/mycluster-shard-00-00-xxxx.mongodb.net:27017", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.IO.IOException: Th
            e authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.#012  at Mono.Security.Protocol.Tls.RecordProtocol.E
            ndReceiveRecord (System.IAsyncResult asyncResult) [0x00037] in <081f2539f5f74de086ddfa5e875c2fff>:0 #012  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in <081f2539f5f74de086
            ddfa5e875c2fff>:0 #012  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in <081f2539f5f74de086ddfa5e875c2fff>:0 #012   --- End of inner exception stack trace ---#012  at Mono.Security.Protocol.Tls.SslClient
            Stream.EndNegotiateHandshake (System.IAsyncResult result) [0x00032] in <081f2539f5f74de086ddfa5e875c2fff>:0 #012  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in <081f2539f5f74de086ddfa5e875c2
            fff>:0 #012   --- End of inner exception stack trace ---#012  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x0004b] in <081f2539f5f74de086ddfa5e875c2fff>:0 #012  at Mono.Net.Security.Private.LegacySslStream.EndAuthenticate
            AsClient (System.IAsyncResult asyncResult) [0x0000e] in <8ad536febd8d4466a395baa742076330>:0 #012  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endActio
            n, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <f5397d5e4dd146a1b2f33671be050366>:0 #012--- End of stack trace from previous location where exception was thrown ---#012  at System.Runtime.ExceptionService
            s.ExceptionDispatchInfo.Throw () [0x0000c] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runti
            me.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [
            0x00008] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at MongoDB.Driver.Core.Connections.SslStreamFactory+<Cre
            ateStreamAsync>d__4.MoveNext () [0x00182] in <50e51985348f46898d8a3c7759e943e8>:0 #012--- End of stack trace from previous location where exception was thrown ---#012  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <f5397d5e4dd1
            46a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebugger
            Notification (System.Threading.Tasks.Task task) [0x00028] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at Syst
            em.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at MongoDB.Driver.Core.Connections.BinaryConnection+<OpenHelperAsync>d__48.MoveNext () [0x000b6] in <50e
            51985348f46898d8a3c7759e943e8>:0 #012   --- End of inner exception stack trace ---#012  at MongoDB.Driver.Core.Connections.BinaryConnection+<OpenHelperAsync>d__48.MoveNext () [0x001b4] in <50e51985348f46898d8a3c7759e943e8>:0 #012--- End of stack trace from previou
            s location where exception was thrown ---#012  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.T
            ask task) [0x0003e] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime
            .CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <f5397d5e4dd146a1b2f33671be050366>:0 #012  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+Config

堆栈跟踪:

            at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException (MongoDB.Driver.Core.Clusters.ServerSelectors.IServerSelector selector, MongoDB.Driver.Core.Clusters.ClusterDescription description) [0x00013] in <50e51985348f46898d8a3
            c7759e943e8>:0 #012  at MongoDB.Driver.Core.Clusters.Cluster+WaitForDescriptionChangedHelper.HandleCompletedTask (System.Threading.Tasks.Task completedTask) [0x00009] in <50e51985348f46898d8a3c7759e943e8>:0 #012  at MongoDB.Driver.Core.Clusters.Cluster.WaitForD
            escriptionChanged (MongoDB.Driver.Core.Clusters.ServerSelectors.IServerSelector selector, MongoDB.Driver.Core.Clusters.ClusterDescription description, System.Threading.Tasks.Task descriptionChangedTask, System.TimeSpan timeout, System.Threading.Cancellati
            onToken cancellationToken) [0x00021] in <50e51985348f46898d8a3c7759e943e8>:0 #012  at MongoDB.Driver.Core.Clusters.Cluster.SelectServer (MongoDB.Driver.Core.Clusters.ServerSelectors.IServerSelector selector, System.Threading.CancellationToken cancellationTok
            en) [0x00057] in <50e51985348f46898d8a3c7759e943e8>:0 #012  at MongoDB.Driver.MongoClient.AreSessionsSupportedAfterServerSelection (System.Threading.CancellationToken cancellationToken) [0x00006] in <e62075b47b974b1bb87a7dfdf33dbed3>:0 #012  at MongoDB.Driver.M
            ongoClient.AreSessionsSupported (System.Threading.CancellationToken cancellationToken) [0x0001b] in <e62075b47b974b1bb87a7dfdf33dbed3>:0 #012  at MongoDB.Driver.MongoClient.StartImplicitSession (System.Threading.CancellationToken cancellationToken) [0x00000]
            in <e62075b47b974b1bb87a7dfdf33dbed3>:0 #012  at MongoDB.Driver.OperationExecutor.StartImplicitSession (System.Threading.CancellationToken cancellationToken) [0x00000] in <e62075b47b974b1bb87a7dfdf33dbed3>:0 #012  at MongoDB.Driver.MongoCollectionImpl`1[TDocum
            ent].UsingImplicitSession[TResult] (System.Func`2[T,TResult] func, System.Threading.CancellationToken cancellationToken) [0x00000] in <e62075b47b974b1bb87a7dfdf33dbed3>:0 #012  at MongoDB.Driver.MongoCollectionImpl`1[TDocument].Watch[TResult] (MongoDB.Driver
            .PipelineDefinition`2[TInput,TOutput] pipeline, MongoDB.Driver.ChangeStreamOptions options, System.Threading.CancellationToken cancellationToken) [0x0002f] in <e62075b47b974b1bb87a7dfdf33dbed3>:0 #012  at StateDataStore.CloudControlRoomState.Listen () [0x001
            41] in <97005dd8325444bca5185303cdcf2ece>:0
            Warning: Failed to connect to the agentx master agent ([NIL]):
enter code here

任何帮助!

.net mongodb mono ubuntu-16.04 mongodb-atlas
1个回答
0
投票

MongoDb Atlas免费软件不支持变更流,这就是我们遇到这个问题的原因。

当MongoDb安装在AWS EC2实例中时,它工作正常,我们能够连接和监听更改流。

© www.soinside.com 2019 - 2024. All rights reserved.