首页 文章

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

提问于
浏览
1

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

场景:

  • 使用Raven build#2261

  • 主数据库:本地名称为"it23"

  • Slave DB:具有远程名称“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格式正确 .

但是,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

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

谁能发现我的错误?

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

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

  • 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 /”文件 .

相关问题