CouchDB: This database failed to load / No DB shards could be opened (logged in as admin)

醉酒当歌 提交于 2019-12-04 17:45:33

The error was caused by update to CouchDB 2.1.1. It's explained on the CouchDB website that the new version brings breaking changes and a line has to be modified in the config file.

So I had to change this file:

$ sudo vim /opt/couchdb/etc/vm.args

-name couchdb@localhost changed to -name couchdb@127.0.0.1

Don't forget to move the DB shards to the new node and restart CouchDB.

This script is useful for migrating the DB shards to the new node:

#!/bin/bash
curl "http://admin:password@127.0.0.1:5986/_dbs/$1" > $1.json
cat $1.json | sed s/$2/$3/g > $1_edited.json
curl -X PUT "http://admin:password@127.0.0.1:5986/_dbs/$1" -d @$1_edited.json
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!