RavenDB Replication问题 - 无法找到数据库

时间:2013-03-09 00:28:19

标签: ravendb

已按照文档进行操作,但无法通过WAN为RavenDB进行复制。

情景:

  • 使用Raven build#2261
  • 主DB:本地名称为" it23"
  • Slave DB:具有远程名称" http://184.169.xxx.xxx" (xxx适用于 隐私)

在两台服务器上,我创建了一个名为" TonyTest"。

的数据库

在Master db上,我使用以下文档设置了复制:

{
  "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格式正确。

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

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

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

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

看起来远程服务器正在说db" TonyTest'无法找到,但它已被创建。

有人能发现我的错误吗?

根据Ayende的请求,以下是尝试设置复制后LOCAL服务器的一些日志样本(我再次用xxx替换IP以保护隐私)。我们在LOCAL数据库的日志中看不到任何错误。我们确实在REMOTE数据库日志中看到错误弹出。这似乎意味着LOCAL数据库连接到REMOTE数据库,但复制不会发生。以下是本地日志:

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乌鸦日志中看到以下错误:

无法关闭回复

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<---

1 个答案:

答案 0 :(得分:1)

解决了这个问题。虽然我不明白其全部原因。

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

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

默认为

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

当主服务器和从服务器位于同一台计算机上时,默认工作正常。但是当主服务器和从服务器位于不同的计算机上时(在LAN上或通过WAN),复制失败。

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