COUCHDB

Healthcheck

1
# curl -s http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984/_up  | jq

List all databases

1
# curl -s http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984/_all_dbs  | jq

Database info

1
# curl -s http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984/<db>  | jq

List all docs from a database

1
# curl -s http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984/<db>/_all_docs  | jq

Info from a doc

1
# curl -s http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984/<db>/<id_doc>  | jq

Restart

1
# curl -s -X POST -H"Content-Type: application/json" -u $COUCHDB_USER:$COUCHDB_PASSWORD localhost:5984/_node/couchdb@<node_name>/_restart

List member of a cluster

1
# curl -s http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984/_membership  | jq

add member

1
# curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD -X PUT "http://localhost:5986/_nodes/couchdb@<node_name>" -d {}

get rev

1
# curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD  "http://localhost:5986/_nodes/couchdb@<node_name>"

del member

1
# curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD -X DELETE "http://localhost:5986/_nodes/couchdb@<node_name>?rev=1-967a00dff5e02add41820138abb3284d"

set/unset maintenance mode

1
# curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD -X PUT -H "Content-type: application/json" localhost:5984/_node/couchdb@<node_name>/_config/couchdb/maintenance_mode -d "\"false\""

Show config

1
# curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD -X GET -H "Content-type: application/json" localhost:5984/_node/couchdb@<node_name>/_config/couchdb
# curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD -X GET -H "Content-type: application/json" localhost:5984/_node/couchdb@<node_name>/_config

Force db syn

1
# curl -s -X POST -H"Content-Type: application/json" -u $COUCHDB_USER:$COUCHDB_PASSWORD localhost:5984/<db>/_sync_shards