Я пытаюсь реплицировать Couchbase Enterprise DB с помощью библиотеки C# Couchbase.Lite. Доступ к шину syn c осуществляется через туннель S SH. Даже если я использую его, как описано в документации, репликация не работает.
Это журналы Couchbase Lite:
2020-2-6 02:05:21.032+01:00 [1]| INFO) [Database] (Startup) [1] CouchbaseLite/2.7.0 (.NET; Microsoft Windows 10.0.18363 ) Build/109 LiteCore/2.7.0 (157) Commit/7031539e
2020-2-6 02:05:21.042+01:00 [1]| WARNING) [Database] (Logging) [1] Database.Log.File.Config is null, meaning file logging is disabled. Log files required for product support are not being generated.
Database replicator activity changed to Connecting
Invalid URI: The hostname could not be parsed.
2020-2-6 02:05:36.091+01:00 [10]| ERROR) [Network] {C4SocketImpl#1}==> class litecore::repl::C4SocketImpl ws://localhost:4984/fieldforce/_blipsync @00000245EA1BCB50
2020-2-6 02:05:36.091+01:00 [10]| ERROR) [Network] {C4SocketImpl#1} No response received after 15 sec -- disconnecting
2020-2-6 02:05:36.093+01:00 [12]| WARNING) [Network] {C4SocketImpl#1} Unexpected or unclean socket disconnect! (reason=Network error, code=3)
2020-2-6 02:05:36.096+01:00 [4]| ERROR) [Replicator] {Repl#2}==> class litecore::repl::Replicator D:\Repos\ReplicatorTest\ConsoleApp1\bin\Debug\netcoreapp2.2\CouchbaseLite\fieldforce.cblite2\ ->ws://loc
alhost:4984/fieldforce/_blipsync @00000245EA1BC6D8
2020-2-6 02:05:36.096+01:00 [4]| ERROR) [Replicator] {Repl#2} Got LiteCore error: Network error 3 "connection timed out"
Database replicator activity changed to Connecting; last exception: Couchbase.Lite.CouchbaseNetworkException: CouchbaseLiteException (NetworkDomain / 3): connection timed out.
Database replicator activity changed to Offline; last exception: Couchbase.Lite.CouchbaseNetworkException: CouchbaseLiteException (NetworkDomain / 3): connection timed out.
Database replicator activity changed to Connecting
Invalid URI: The hostname could not be parsed.
2020-2-6 02:05:53.107+01:00 [10]| ERROR) [Network] {C4SocketImpl#3}==> class litecore::repl::C4SocketImpl ws://localhost:4984/fieldforce/_blipsync @00000245EA771EC0
2020-2-6 02:05:53.107+01:00 [10]| ERROR) [Network] {C4SocketImpl#3} No response received after 15 sec -- disconnecting
2020-2-6 02:05:53.108+01:00 [20]| WARNING) [Network] {C4SocketImpl#3} Unexpected or unclean socket disconnect! (reason=Network error, code=3)
2020-2-6 02:05:53.108+01:00 [21]| ERROR) [Replicator] {Repl#4}==> class litecore::repl::Replicator D:\Repos\ReplicatorTest\ConsoleApp1\bin\Debug\netcoreapp2.2\CouchbaseLite\fieldforce.cblite2\ ->ws://lo
calhost:4984/fieldforce/_blipsync @00000245EA1BC2C8
2020-2-6 02:05:53.108+01:00 [21]| ERROR) [Replicator] {Repl#4} Got LiteCore error: Network error 3 "connection timed out"
Database replicator activity changed to Connecting; last exception: Couchbase.Lite.CouchbaseNetworkException: CouchbaseLiteException (NetworkDomain / 3): connection timed out.
Database replicator activity changed to Offline; last exception: Couchbase.Lite.CouchbaseNetworkException: CouchbaseLiteException (NetworkDomain / 3): connection timed out.
Это код C#:
var database = new Database("foo");
var targetUri = new Uri("ws://localhost:4984/foo");
var gateway = new URLEndpoint(targetUri);
var replicationConfig = new ReplicatorConfiguration(database, gateway)
{
ReplicatorType = ReplicatorType.PushAndPull,
Authenticator = new BasicAuthenticator("user", "password")
};
var replicator = new Replicator(replicationConfig);
replicator.AddChangeListener((sender, args) =>
{
var activity = args.Status.Activity;
var error = args.Status.Error;
if (error == null)
{
Console.WriteLine($"Database replicator activity changed to {activity}");
}
else
{
Console.WriteLine($"Database replicator activity changed to {activity}; last exception: {error}");
}
});
replicator.Start();