1

已遵循文档,但无法通过 WAN 为 RavenDB 进行复制。

设想:

  • 使用 Raven 构建 #2261
  • Master DB:本地名称为“it23”
  • 从数据库:有一个远程名称“ http://184.169.xxx.xxx ”(xxx 是为了隐私)

在两台服务器上,我都创建了一个名为“TonyTest”的数据库。

在主数据库上,我使用以下文档设置了复制:

{
  "Destinations": [
    {
      "Url": "http://184.169.xxx.xxx:8080",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "TonyTest",
      "TransitiveReplicationBehavior": "None",
      "IgnoredClient": false,
      "Disabled": false,
      "ClientVisibleUrl": null
    }
  ]
}

当使用相同的 URL 浏览远程服务器时:http://184.169.xxx.xxx:8080,RavenDB 工作室正确启动,我可以看到 TestTony 数据库。这似乎证实了 URL 的格式正确。

但是,主数据库会立即生成一个显示失败的文档:

{   
  "Destination": "http://184.169.xxx.xxx:8080/databases/TonyTest",  
  "FailureCount": 142 
}

当我们查看远程数据库的日志时,我们看到与主数据库有通信,但复制没有完成。

Debug   3/9/2013 12:19:44 AM    Document with key 'Raven/Replication/Sources/http://it23:8080/databases/TonyTest' was not found     Raven.Storage.Esent.StorageActions.DocumentStorageActions

看起来远程服务器说找不到数据库“TonyTest”,但它已创建。

谁能发现我的错误?

根据 Ayende 的要求,以下是尝试设置复制后来自 LOCAL 服务器的一些日志示例(我再次将 IP 替换为 xxx 以保护隐私)。我们在 LOCAL db 的日志中看不到任何错误。我们确实在远程数据库日志中看到了错误弹出。这似乎暗示 LOCAL db 正在连接到 REMOTE db,但不会发生复制。以下是本地日志:

Debug   3/11/2013 3:17:00 PM    No work was found, workerWorkCounter: 17626, for: ReducingExecuter, will wait for additional work       Raven.Database.Indexing.WorkContext
Debug   3/11/2013 3:17:00 PM    Going to index 1 documents in IndexName: Raven/DocumentsByEntityName, LastIndexedEtag: 00000001-0000-0100-0000-000000002265: (Raven/Replication/Destinations/184.169.xxx.xxx8080databasesTonyTest)      Raven.Database.Indexing.AbstractIndexingExecuter
Debug   3/11/2013 3:17:00 PM    Document with key 'Raven/Studio/PriorityColumns' was not found      Raven.Storage.Esent.StorageActions.DocumentStorageActions
Debug   3/11/2013 3:16:56 PM    Going to index 1 documents in IndexName: Raven/DocumentsByEntityName, LastIndexedEtag: 00000001-0000-0100-0000-000000002256: (Raven/Replication/Destinations/184.169.xxx.xxx8080databasesTonyTest)      Raven.Database.Indexing.AbstractIndexingExecuter

更新 3/11 8:24p 太平洋时间我现在在 MASTER/Local raven 日志中看到以下错误:

未能关闭响应

System.AggregateException: One or more errors occurred. ---> System.Net.HttpListenerException: An operation was attempted on a nonexistent network connection
   at System.Net.HttpResponseStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at Raven.Database.Util.Streams.BufferPoolStream.Dispose(Boolean disposing) in c:\Builds\RavenDB-Stable\Raven.Database\Util\Streams\BufferPoolStream.cs:line 144
   at System.IO.Stream.Close()
   at Raven.Database.Impl.ExceptionAggregator.Execute(Action action) in c:\Builds\RavenDB-Stable\Raven.Database\Impl\ExceptionAggregator.cs:line 23
   --- End of inner exception stack trace ---
   at Raven.Database.Impl.ExceptionAggregator.ThrowIfNeeded() in c:\Builds\RavenDB-Stable\Raven.Database\Impl\ExceptionAggregator.cs:line 38
   at Raven.Database.Server.Abstractions.HttpListenerResponseAdapter.Close() in c:\Builds\RavenDB-Stable\Raven.Database\Server\Abstractions\HttpListenerResponseAdapter.cs:line 94
   at Raven.Database.Server.Abstractions.HttpListenerContextAdpater.FinalizeResponse() in c:\Builds\RavenDB-Stable\Raven.Database\Server\Abstractions\HttpListenerContextAdpater.cs:line 92
---> (Inner Exception #0) System.Net.HttpListenerException (0x80004005): An operation was attempted on a nonexistent network connection
   at System.Net.HttpResponseStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at Raven.Database.Util.Streams.BufferPoolStream.Dispose(Boolean disposing) in c:\Builds\RavenDB-Stable\Raven.Database\Util\Streams\BufferPoolStream.cs:line 144
   at System.IO.Stream.Close()
   at Raven.Database.Impl.ExceptionAggregator.Execute(Action action) in c:\Builds\RavenDB-Stable\Raven.Database\Impl\ExceptionAggregator.cs:line 23<---
4

1 回答 1

1

解决了这个问题。虽然我不明白为什么。

在 SLAVE 服务器上,您必须将 raven.server.exe 配置文件设置为具有以下键:

<add key="Raven/AnonymousAccess" value="All"/>

默认是

<add key="Raven/AnonymousAccess" value="Get"/>.

当 master 和 slave 在同一台机器上时,默认值工作正常。但是当主服务器和从服务器在不同的机器上时(无论是在 LAN 上,还是在 WAN 上),复制失败。

我永远无法在 master 上找到指向他的问题的日志条目。我能看到的唯一日志条目是从服务器上说找不到 Raven/Replication/Sources/。我意识到主服务器正在连接从服务器,但从服务器无法远程创建“Raven/Replication/Sources/”文档。

于 2013-03-13T02:45:34.807 回答