如何在Dokku中复制CouchDB

Mat*_*len 5 couchdb dokku

我想拍摄一个在app中运行的数据库的快照www并将其放入app中staging。当我使用克隆或创建/导入进行操作时,没有可用的数据。

我打算怎么做?

matt@server:~$ dokku run www curl http://www:password@dokku-couchdb-www:5555/www

{"db_name":"www","doc_count":4966,"doc_del_count":232,"update_seq":46475,"purge_seq":0,"compact_running":false,"disk_size":3071180923,"data_size":334987077,"instance_start_time":"1500006610823893","disk_format_version":6,"committed_update_seq":46475}
Run Code Online (Sandbox Code Playgroud)

因此,您可以看到有4966个文档。

matt@server:~$ dokku couchdb:clone www staging_www
-----> Starting container
       Waiting for container to be ready
=====> CouchDB container created: staging_www
       DSN: http://staging_www:password@dokku-couchdb-staging-www:5555/staging_www
-----> Copying data from www to staging_www
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                                                                                                Dload  Upload   Total   Spent    Left  Speed
100 1110M    0 1110M    0     0  30.4M      0 --:--:--  0:00:36 --:--:-- 31.9M
                                                                              -----> Done
Run Code Online (Sandbox Code Playgroud)

因此,克隆中没有错误。然后我跑

dokku couchdb:link staging_www staging
dokku couchdb:promote staging_www staging
Run Code Online (Sandbox Code Playgroud)

并且没有错误,但是如果我检查数据库:

matt@server:~$ dokku run staging curl http://staging_www:password@dokku-couchdb-staging-www:5555/staging_www
{"db_name":"staging_www","doc_count":1,"doc_del_count":0,"update_seq":1,"purge_seq":0,"compact_running":false,"disk_size":4188,"data_size":342,"instance_start_time":"1509536857606369","disk_format_version":6,"committed_update_seq":1}
Run Code Online (Sandbox Code Playgroud)

文件数为1,我无法存取staging应用程式中的任何资料。

我也尝试过

dokku couchdb:export www > www.couch
dokku couchdb:create staging_www
dokku couchdb:import staging_www < www.couch
dokku couchdb:link staging_www staging
dokku couchdb:promote staging_www staging
Run Code Online (Sandbox Code Playgroud)

没有错误,但是我又在数据库中得到了1个文档。

我该怎么办?

小智 -1

我通常只使用此处找到的couchdb dokku 插件

Curl 在处理多个文件时可能会超时,因此我使用该插件进行暂存。十分简单