Я раскручиваю набор реплик из одного узла из приложения csharp.Однако драйвер выдает исключение тайм-аута при попытке «replSetInitiate» набора реплик.Мы будем благодарны за любые мысли о том, что не так.Спасибо!
// Тестирование реплики одного узла
mongodb-win32-x86_64-2008plus-ssl-4.0.2\bin\mongod --sslMode disabled --dbpath "C:\Users\foobar\AppData\Local\Temp\sj5ufivo.hgy" --port 27017 --bind_ip 127.0.0.1 --replSet singleNodeReplSet
// Код для запуска набора реплик
MongoClient client = new MongoClient("mongodb://127.0.0.1:{0}/?replicaSet=singleNodeReplSet".Formatted(port));
var admin = client.GetDatabase("admin");
var commandDocument = new BsonDocument("replSetInitiate", new BsonDocument());
var replSet = admin.RunCommand<BsonDocument>(commandDocument);
// Исключение
System.TimeoutException
HResult=0x80131505
Message=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 : "Connected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "127.0.0.1:27017" }", EndPoint: "127.0.0.1:27017", State: "Connected", Type: "ReplicaSetGhost", WireVersionRange: "[0, 7]" }] }.
Source=MongoDB.Driver.Core
StackTrace:
at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)
at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)
at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)
at MongoDB.Driver.MongoClient.AreSessionsSupportedAfterServerSelection(CancellationToken cancellationToken)
at MongoDB.Driver.MongoClient.AreSessionsSupported(CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.StartImplicitSession(CancellationToken cancellationToken)
at MongoDB.Driver.MongoDatabaseImpl.UsingImplicitSession[TResult](Func`2 func, CancellationToken cancellationToken)