【发布时间】:2013-03-13 10:45:34
【问题描述】:
已遵循文档,但无法通过 WAN 为 RavenDB 进行复制。
场景:
- 使用 Raven 构建 #2261
- 主数据库:本地名称为“it23”
- 从属 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 db 的日志时,我们看到与 master 有通信,但复制没有完成。
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 的要求,以下是尝试设置复制后来自本地服务器的一些日志示例(我再次将 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<---
【问题讨论】:
-
目标日志不相关。您在源代码中看到的错误是什么?
-
你好艾扬德。我已经复制了上面的一些本地/源日志。我们似乎没有看到任何我承认的错误。有什么想法吗?
-
另一个更新,我在我的 PC 上创建了第二个 RavenDB 实例,并且能够完美复制。通过 WAN 进行复制需要哪些特殊配置?
-
另一个更新。我已经打开了防火墙上的所有端口,这些端口将允许我的远程/从属数据库“看到”主数据库。仍然没有运气。我得到帮助的唯一日志是在远程/从属设备上:找不到密钥为“Raven/Replication/Sources/it23:8080/databases/Pete”的文档。 it23 是我的主/本地数据库的网络名称。我是否需要使用“ClientVisibleUrl”属性重新指向主服务器。我找不到有关如何使用该属性的文档。
-
当我在局域网上复制时,“Raven/Replication/Sources/”会立即在从服务器上创建。但是在 WAN 上不会创建该文件。这可能是许可的事情吗?
标签: ravendb