Update replication guide and add to sidebar

This commit is contained in:
Jeff Mitchell 2017-03-17 12:28:03 -04:00
parent 01157459f8
commit d349fdf7fa
4 changed files with 167 additions and 20 deletions

View File

@ -14,5 +14,9 @@ guidance to do them safely.
The following guides are available: The following guides are available:
* [Generate Root](/docs/guides/generate-root.html) - This guide covers how to * [Generate a Root Token](/docs/guides/generate-root.html) - This guide covers
generate new root tokens using unseal keys. how to generate new root tokens using unseal keys.
* [Setting Up and Managing Replication](/docs/guides/replication.html) - This
guide covers how to set up and manage Vault Replication, a part of Vault
Enterprise.

View File

@ -25,7 +25,11 @@ both](https://www.vaultproject.io/docs/http/sys-replication.html).
### Activating the Primary ### Activating the Primary
To activate the primary, run `vault write -f sys/replication/primary/enable`. To activate the primary, run:
$ vault write -f sys/replication/primary/enable
There is currently one optional argument: `primary_cluster_addr`. This can be There is currently one optional argument: `primary_cluster_addr`. This can be
used to override the cluster address that the primary advertises to the used to override the cluster address that the primary advertises to the
@ -34,18 +38,24 @@ members of a single cluster and primary/secondary clusters.
### Fetching a Secondary Token ### Fetching a Secondary Token
To fetch a secondary bootstrap token, run `vault write To fetch a secondary bootstrap token, run:
sys/replication/primary/secondary-token id=<id>`.
The value for ID is opaque to Vault and can be any identifying value you want;
$ vault write sys/replication/primary/secondary-token id=<id>
The value for `id` is opaque to Vault and can be any identifying value you want;
this can be used later to revoke the secondary and will be listed when you read this can be used later to revoke the secondary and will be listed when you read
replication status on the primary. You will get back a normal wrapped response, replication status on the primary. You will get back a normal wrapped response,
except that the token will be a JWT instead of UUID-formatted random bytes. except that the token will be a JWT instead of UUID-formatted random bytes.
### Activating a Secondary ### Activating a Secondary
To activate a secondary, run `vault write sys/replication/secondary/enable To activate a secondary using the fetched token, run:
token=<token>`.
$ vault write sys/replication/secondary/enable token=<token>
You must provide the full token value. Be very careful when running this You must provide the full token value. Be very careful when running this
command, as it will destroy all data currently stored in the secondary. command, as it will destroy all data currently stored in the secondary.

View File

@ -0,0 +1,118 @@
---
layout: "http"
page_title: "HTTP API: /sys/replication"
sidebar_current: "docs-http-replication-common"
description: |-
The '/sys/replication' endpoint focuses on managing general operations in Vault Enterprise replication sets
---
# /sys/replication/recover
## POST
<dl>
<dt>Description</dt>
<dd>
Attempts recovery if replication is in an adverse state. For example: an
error has caused replication to stop syncing.
</dd>
<dt>Method</dt>
<dd>POST</dd>
<dt>URL</dt>
<dd>`/sys/replication/recover`</dd>
<dt>Parameters</dt>
<dd>
None
</dd>
<dt>Returns</dt>
<dd>
A `200` response code and a warning.
</dd>
</dl>
# /sys/replication/reindex
## POST
<dl>
<dt>Description</dt>
<dd>
Requires sudo capability. Reindex the local data storage. This can cause
a very long delay depending on the number and size of objects in the data
store.
</dd>
<dt>Method</dt>
<dd>POST</dd>
<dt>URL</dt>
<dd>`/sys/replication/reindex`</dd>
<dt>Parameters</dt>
<dd>
None
</dd>
<dt>Returns</dt>
<dd>
A `200` response code and a warning.
</dd>
</dl>
# /sys/replication/status
## GET
<dl>
<dt>Description</dt>
<dd>
Unauthenticated. Print information about the status of replication (mode,
sync progress, etc).
</dd>
<dt>Method</dt>
<dd>GET</dd>
<dt>URL</dt>
<dd>`/sys/replication/status`</dd>
<dt>Parameters</dt>
<dd>
None
</dd>
<dt>Returns</dt>
<dd>
The printed status of the replication environment. As an example, for a
primary, it will look something like:
```javascript
{
"mode": "primary",
"cluster_id": "d4095d41-3aee-8791-c421-9bc7f88f7c3e",
"known_secondaries": [],
"last_wal": 0,
"merkle_root": "c3260c4c682ff2d6eb3c8bfd877134b3cec022d1",
"request_id": "009ea98c-06cd-6dc3-74f2-c4904b22e535",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"cluster_id": "d4095d41-3aee-8791-c421-9bc7f88f7c3e",
"known_secondaries": [],
"last_wal": 0,
"merkle_root": "c3260c4c682ff2d6eb3c8bfd877134b3cec022d1",
"mode": "primary"
},
"wrap_info": null,
"warnings": null,
"auth": null
}
```
</dd>
</dl>

View File

@ -150,6 +150,21 @@
</ul> </ul>
</li> </li>
<li<%= sidebar_current("docs-http-replication") %>>
<a href="#">Replication</a>
<ul class="nav nav-visible">
<li<%= sidebar_current("docs-http-replication-common") %>>
<a href="/docs/http/sys-replication-common.html">/sys/replication (common)</a>
</li>
<li<%= sidebar_current("docs-http-replication-primary") %>>
<a href="/docs/http/sys-replication-primary.html">/sys/replication/primary</a>
</li>
<li<%= sidebar_current("docs-http-replication-secondary") %>>
<a href="/docs/http/sys-replication-secondary.html">/sys/replication/secondary</a>
</li>
</ul>
</li>
<li<%= sidebar_current("docs-http-rotate") %>> <li<%= sidebar_current("docs-http-rotate") %>>
<a href="#">Key Rotation</a> <a href="#">Key Rotation</a>
<ul class="nav nav-visible"> <ul class="nav nav-visible">