【问题标题】:How can I replicate a CouchDB database?如何复制 CouchDB 数据库?
【发布时间】:2014-07-12 21:01:04
【问题描述】:

我想复制 CouchDB 数据库https://github.com/kirel/detexify-data

很遗憾,我收到一个错误:

$ curl -X POST -H "Content-Type:application/json" -d '{"source":"https://kirelabs.cloudant.com/detexify","target":"detexify"}' http://localhost:5984/_replicate
{"error":"checkpoint_commit_failure","reason":"Failure on source commit: {error,<<\"unauthorized\">>}"}

这似乎是以下错误:https://issues.apache.org/jira/browse/COUCHDB-1524

谁能告诉我是否有解决方法?如何获取数据?

失败的尝试

$ curl -X POST -H "Content-Type:application/json" \
  -d '{"source":"https://kirelabs.cloudant.com/detexify",
       "target":"detexify",
       "use_checkpoints":false}'
  http://localhost:5984/_replicate

{"error":"checkpoint_commit_failure",
 "reason":"Failure on source commit: {error,<<\"unauthorized\">>}"}

【问题讨论】:

    标签: couchdb


    【解决方案1】:

    一个快速简单的解决方案是不使用检查点。

    {"source":"https://kirelabs.cloudant.com/detexify","target":"detexify","use_checkpoints":false}

    我用这个请求进行了尝试,并设法复制了您的数据。

    更新

    好吧,我又试了一次,复制对我来说似乎工作得很好。在取消复制之前,我复制了 22.7 mb 的数据。我附上了截图。

    curl -X POST -H "Content-Type:application/json"   -d   '{"source":"https://kirelabs.cloudant.com/detexify",
       "target":"detexify",
       "use_checkpoints":false,"create_target":true}' http://ABBA:dancing-queen@localhost:5984/_replicate
    

    复制命令是从您更新的示例中逐字复制的,除了“create_target”选项和我本地数据库上的管理员基本身份验证。

    【讨论】:

      猜你喜欢
      • 2019-07-13
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 2019-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多