open-vault/website/source/api/system/replication.html.md

119 lines
2.7 KiB
Markdown
Raw Normal View History

2017-03-16 18:57:06 +00:00
---
2017-03-17 18:06:03 +00:00
layout: "api"
2017-03-16 18:57:06 +00:00
page_title: "/sys/replication - HTTP API"
sidebar_current: "docs-http-system-replication"
description: |-
The '/sys/replication' endpoint focuses on managing general operations in Vault Enterprise replication
2017-03-16 18:57:06 +00:00
---
# `/sys/replication`
~> **Enterprise Only**  These endpoints require Vault Enterprise.
2017-03-16 18:57:06 +00:00
## Attempt Recovery
This endpoint attempts recovery if replication is in an adverse state. For
example: an error has caused replication to stop syncing.
| Method | Path | Produces |
| :------- | :--------------------------- | :--------------------- |
| `POST` | `/sys/replication/recover` | `200 application/json` |
### Sample Request
```
$ curl \
--header "X-Vault-Token: ..." \
--request POST \
https://vault.rocks/v1/sys/replication/recover
```
### Sample Response
```json
{
"warnings": ["..."]
}
```
## Reindex Replication
This endpoint reindexes the local data storage. This can cause a very long delay
depending on the number and size of objects in the data store.
**This endpoint requires 'sudo' capability.**
| Method | Path | Produces |
| :------- | :--------------------------- | :--------------------- |
| `POST` | `/sys/replication/reindex` | `200 application/json` |
```
$ curl \
--header "X-Vault-Token: ..." \
--request POST \
https://vault.rocks/v1/sys/replication/reindex
```
### Sample Response
```json
{
"warnings": ["..."]
}
```
## Check Status
This endpoint print information about the status of replication (mode,
sync progress, etc).
This is an authenticated endpoint.
| Method | Path | Produces |
| :------- | :--------------------------- | :--------------------- |
| `GET` | `/sys/replication/status` | `200 application/json` |
### Sample Request
```
$ curl \
https://vault.rocks/v1/sys/replication/status
```
### Sample Response
The printed status of the replication environment. As an example, for a
primary, it will look something like:
```json
{
"request_id": "d13e9665-d610-fea0-357f-8d652aa308cb",
"lease_id": "",
"lease_duration": 0,
"renewable": false,
"data": {
"dr": {
"cluster_id": "a876f38b-7577-25ac-6007-277528c99a1a",
"known_secondaries": [
"2"
],
"last_wal": 43,
"merkle_root": "86d67839f47045f7d24beb4f39b14504d15a146c",
2018-01-23 02:44:38 +00:00
"mode": "primary",
"primary_cluster_addr": ""
},
"performance": {
"cluster_id": "11ab01df-32ea-1d79-b4bc-8bc973c1b749",
"known_secondaries": [
"1"
],
"last_wal": 43,
"merkle_root": "e0531d566b23403101b0868e85b63d6774ba0ef2",
2018-01-23 02:44:38 +00:00
"mode": "primary",
"primary_cluster_addr": ""
}
},
"warnings": null
2017-03-16 18:57:06 +00:00
}
```