couchdb - 我可以使用没有 url 的数据库名称在 CouchDB 中开始复制吗?
问题描述
当我创建两个数据库 'foo' 和 'bar' 然后创建一个文档
{
"_id": "whatever",
"source": "foo",
"target": "bar"
}
在_replicator
数据库中,这应该启动从“foo”到“bar”的同步。但是,我在日志中收到此错误:
Could not open file ./data/foo.couch: no such file or directory
open_result error {not_found,no_db_file} for foo
Replication <hash> failed to start "foo" -> "bar"
如果我使用源/目标数据库的完整 url(例如http://localhost:5984/foo
),同样的工作,但是将我的复制文档耦合到 CouchDB 实例的(当前)url 似乎非常错误和不必要,如果我愿意,我将不得不全部更新它们更改端口等。文档还指出,对于源/目标,可以使用数据库名称或 url。
是否不能使用(相对)数据库名称,如果我只使用名称,为什么会出现上述错误?
我在 Ubuntu 16.04 下使用 CouchDB 2.1.1。
解决方案
在 CouchDB 1.x 时代,您可以仅使用源/目标数据库名称的本地名称来指定复制。在 CouchDB 2.0 的集群世界中,_replicator 数据库需要源和目标中的完整 URL,即使您是从本地复制 -> 本地。
在这个表单的 _replicator 中插入一个文档:
{
"_id": "whatever",
"source": "http://U:P@localhost:5984/source",
"target": "http://U:P@localhost:5984/target"
}
推荐阅读
- wordpress - 当我重新启动我的 ec2 实例时,没有在 AWS 上托管的 wordpress 网站上上传图片
- reactjs - 嗨,我正在寻找在页面导航时保持排序/分页状态
- python - 为什么我的代码给出 TypeError: TypeError: 'int' object has no attribute '__getitem__'?
- flutter - 如何与 moor 一起实施 Change Notifier?
- wordpress - 在 Wordpress 上显示奇怪的消息
- python - 大熊猫解码字符串返回 NaN
- web-component - Web 组件的 disconnectedCallback 上删除事件侦听器的原因
- python - 在 Python 中获取字体字形的轮廓坐标
- git - 我不小心将 Repo1 的 Master 分支拉到本地并将 Remote 更改为 Repo2 并推送到特定分支。如何恢复这个?
- amazon-web-services - 在本地运行 Docker 内的 AWS Lambda