1.3.9. /db/_shards
New in version 2.0.
GET
/{db}/_shards
The response will contain a list of database shards. Each shard will have its internal database range, and the nodes on which replicas of those shards are stored.
Parameters: |
|
---|---|
Request Headers: | |
| |
Response Headers: | |
| |
Response JSON Object: | |
| |
Status Codes: |
|
Request:
GET /db/_shards HTTP/1.1
Accept: */*
Host: localhost:5984
Response:
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 621
Content-Type: application/json
Date: Fri, 18 Jan 2019 19:55:14 GMT
Server: CouchDB/2.4.0 (Erlang OTP/19)
{
"shards": {
"00000000-1fffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"20000000-3fffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"40000000-5fffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"60000000-7fffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"80000000-9fffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"a0000000-bfffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"c0000000-dfffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
],
"e0000000-ffffffff": [
"couchdb@node1.example.com",
"couchdb@node2.example.com",
"couchdb@node3.example.com"
]
}
}
1.3.10. /db/_shards/doc
GET
/{db}/_shards/{docid}
Returns information about the specific shard into which a given document has been stored, along with information about the nodes on which that shard has a replica.
Parameters: |
|
---|---|
Request Headers: | |
| |
Response Headers: | |
| |
Response JSON Object: | |
| |
Status Codes: |
|
Request:
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 94
Content-Type: application/json
Date: Fri, 18 Jan 2019 20:08:07 GMT
Server: CouchDB/2.3.0-9d4cb03c2 (Erlang OTP/19)
Response:
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 94
Content-Type: application/json
Date: Fri, 18 Jan 2019 20:26:33 GMT
Server: CouchDB/2.3.0-9d4cb03c2 (Erlang OTP/19)
{
"range": "e0000000-ffffffff",
"nodes": [
"node1@127.0.0.1",
"node2@127.0.0.1",
"node3@127.0.0.1"
]
}
1.3.11. /db/_sync_shards
New in version 2.3.1.
POST
/{db}/_sync_shards
For the given database, force-starts internal shard synchronization for all replicas of all database shards.
This is typically only used when performing cluster maintenance, such as moving a shard.
Parameters: |
|
---|---|
Request Headers: | |
| |
Response Headers: | |
| |
Response JSON Object: | |
| |
Status Codes: |
|
Request:
POST /db/_sync_shards HTTP/1.1
Host: localhost:5984
Accept: */*
Response:
HTTP/1.1 202 Accepted
Cache-Control: must-revalidate
Content-Length: 12
Content-Type: application/json
Date: Fri, 18 Jan 2019 20:19:23 GMT
Server: CouchDB/2.3.0-9d4cb03c2 (Erlang OTP/19)
X-Couch-Request-ID: 14f0b8d252
X-CouchDB-Body-Time: 0
{
"ok": true
}