A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/vault/api-docs/system/replication/replication-performance below:

/sys/replication - HTTP API | Vault

This endpoint prints information about the status of replication (mode, sync progress, etc).

This is an unauthenticated endpoint.

Method Path GET /sys/replication/performance/status Sample request
$ curl \
    http://127.0.0.1:8200/v1/sys/replication/performance/status
Sample response from primary

The printed status of the replication environment. As an example, for a primary, it will look something like:

{
  "data": {
    "cluster_id": "00616ea0-3094-5017-29f9-644f3633f0da",
    "corrupted_merkle_tree": false,
    "known_secondaries": [
      "cd0463e0-a37f-7421-345e-aad53007479f"
    ],
    "last_corruption_check_epoch": "-62135596800",
    "last_performance_wal": 223,
    "last_reindex_epoch": "0",
    "last_wal": 223,
    "merkle_root": "7b75cf69bb9a862913b0de2478164e046d242e0f",
    "mode": "primary",
    "primary_cluster_addr": "",
    "secondaries": [
      {
        "api_address": "https://127.0.0.1:49155",
        "clock_skew_ms": "0",
        "cluster_address": "https://127.0.0.1:49160",
        "connection_status": "connected",
        "last_heartbeat": "2024-03-04T10:05:56-05:00",
        "last_heartbeat_duration_ms": "0",
        "node_id": "cd0463e0-a37f-7421-345e-aad53007479f",
        "replication_primary_canary_age_ms": "660"
      }
    ],
    "ssct_generation_counter": 0,
    "state": "running"
  }
}
Sample response from secondary

The printed status of the replication environment. As an example, for a secondary, it will look something like:

{
  "data": {
    "cluster_id": "00616ea0-3094-5017-29f9-644f3633f0da",
    "connection_state": "ready",
    "corrupted_merkle_tree": false,
    "known_primary_cluster_addrs": [
      "https://127.0.0.1:65524",
      "https://127.0.0.1:65525",
      "https://127.0.0.1:65526"
    ],
    "last_corruption_check_epoch": "-62135596800",
    "last_reindex_epoch": "1709564740",
    "last_remote_wal": 223,
    "last_start": "2024-03-04T10:05:48-05:00",
    "merkle_root": "7b75cf69bb9a862913b0de2478164e046d242e0f",
    "mode": "secondary",
    "primaries": [
      {
        "api_address": "https://127.0.0.1:65521",
        "clock_skew_ms": "0",
        "cluster_address": "https://127.0.0.1:65524",
        "connection_status": "connected",
        "last_heartbeat": "2024-03-04T10:05:56-05:00",
        "last_heartbeat_duration_ms": "0",
        "replication_primary_canary_age_ms": "660"
      }
    ],
    "primary_cluster_addr": "https://127.0.0.1:65524",
    "secondary_id": "cd0463e0-a37f-7421-345e-aad53007479f",
    "ssct_generation_counter": 0,
    "state": "stream-wals"
  }
}

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint enables replication in primary mode. This is used when replication is currently disabled on the cluster (if the cluster is already a secondary, it must be promoted).

Only one primary should be active at a given time. Multiple primaries may result in data loss!

Method Path POST /sys/replication/performance/primary/enable Parameters Sample payload Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/enable

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint demotes a performance primary cluster to a performance secondary. This secondary cluster will not attempt to connect to a primary (see the update-primary call), but will maintain knowledge of its cluster ID and can be reconnected to the same replication set without wiping local storage.

Method Path POST /sys/replication/performance/primary/demote Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/demote

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint disables Performance Replication entirely on the cluster. Any performance secondaries will no longer be able to connect. Caution: re-enabling this node as a primary or secondary will change its cluster ID; in the secondary case this means a wipe of the underlying storage when connected to a primary, and in the primary case, secondaries connecting back to the cluster (even if they have connected before) will require a wipe of the underlying storage.

Method Path POST /sys/replication/performance/primary/disable Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/disable

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint generates a performance secondary activation token for the cluster with the given opaque identifier, which must be unique. This identifier can later be used to revoke a secondary's access.

This endpoint requires 'sudo' capability.

Method Path POST /sys/replication/performance/primary/secondary-token Parameters Sample payload Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/secondary-token
Sample response
{
  "request_id": "",
  "lease_id": "",
  "lease_duration": 0,
  "renewable": false,
  "data": null,
  "warnings": null,
  "wrap_info": {
    "token": "fb79b9d3-d94e-9eb6-4919-c559311133d6",
    "ttl": 300,
    "creation_time": "2016-09-28T14:41:00.56961496-04:00",
    "wrapped_accessor": ""
  }
}

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint revokes a performance secondary's ability to connect to the performance primary cluster; the secondary will immediately be disconnected and will not be allowed to connect again unless given a new activation token.

Method Path POST /sys/replication/performance/primary/revoke-secondary Parameters Sample payload Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/revoke-secondary

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint is used to modify the mounts and namespaces that are filtered to a secondary. Filtering can be specified in allow mode or deny mode. In allow mode the secret and auth mounts that are specified are included to the selected secondary. In deny mode, the mount and namespace paths are excluded.

Method Path POST /sys/replication/performance/primary/paths-filter/:id Parameters Sample payload
{
  "mode": "allow",
  "paths": ["secret/", "ns1/"]
}
Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/paths-filter/mySecondaryID

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint is used to read the mode and the mount/namespace paths that are filtered for a secondary.

Method Path GET /sys/replication/performance/primary/paths-filter/:id 200 (empty body) Parameters Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/paths-filter/mySecondaryID
Sample response
{
  "mode": "allow",
  "paths": ["secret/", "ns1/"]
}

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint is used to delete the mount and namespace filters for a secondary.

Method Path DELETE /sys/replication/performance/primary/paths-filter/:id Parameters Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request DELETE \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/paths-filter/mySecondaryID

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint is used to read the namespace and the mount paths that are dynamically filtered for a secondary on the primary.

Method Path GET /sys/replication/performance/primary/dynamic-filter/:id 200 (empty body) Parameters Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    http://127.0.0.1:8200/v1/sys/replication/performance/primary/dynamic-filter/mySecondaryID
Sample response
{
  "dynamic_filtered_mounts": ["ns1/ns2/secret/", "ns1/kv/"],
  "dynamic_filtered_namespaces": ["ns1/", "ns1/ns2/"]
}

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint is used to read the namespace and the mount paths that are dynamically filtered for a secondary on the secondary.

Method Path GET /sys/replication/performance/secondary/dynamic-filter/:id 200 (empty body) Parameters Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/dynamic-filter/mySecondaryID
Sample response
{
  "dynamic_filtered_mounts": ["ns1/ns2/secret/", "ns1/kv/"],
  "dynamic_filtered_namespaces": ["ns1/", "ns1/ns2/"]
}

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint allows fetching a public key that is used to encrypt the returned credential information (instead of using a response wrapped token). This avoids needing to make an API call to the primary during activation.

Method Path POST /sys/replication/performance/secondary/generate-public-key Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/generate-public-key

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint enables Performance Replication on a secondary using a secondary activation token.

This will immediately clear all data in the secondary cluster!

Method Path POST /sys/replication/performance/secondary/enable Parameters Sample payload Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/enable

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint promotes the performance secondary cluster to performance primary. For data safety and security reasons, new secondary tokens will need to be issued to other secondaries, and there should never be more than one performance primary at a time.

Method Path POST /sys/replication/performance/secondary/promote Parameters Sample payload Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/promote

Restricted endpoint

Clients must call the API path from the root namespace.

This endpoint disables Performance Replication entirely on the cluster. The cluster will no longer be able to connect to the performance primary.

Re-enabling this node as a performance primary or secondary will change its cluster ID; in the secondary case this means a wipe of the underlying storage when connected to a primary, and in the primary case, secondaries connecting back to the cluster (even if they have connected before) will require a wipe of the underlying storage.

Method Path POST /sys/replication/performance/secondary/disable Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/disable

Restricted endpoint

Clients must call the API path from the root namespace.

The update endpoint changes the primary cluster assigned to a performance secondary cluster. Changing the primary cluster assignment does not wipe data in the secondary cluster.

There are two ways to update the primary assignment:

  1. Use a secondary activation token with the token parameter.
  2. Use primary cluster addresses with the update_primary_addrs parameter. During the update, cluster addresses are pinged one at a time via gRPC. The first cluster to respond successfully is assigned as the new primary address.

The two update methods are mutually exclusive. You may use one or the other, but not both. A good rule of thumb is to use token on DR secondary clusters and update_primary_addrs on performance secondary clusters.

Method Path POST /sys/replication/performance/secondary/update-primary Parameters Sample payload Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/update-primary
Sample payload
{
  "update_primary_addrs": ["10.0.0.2:8201"]
}
Sample request
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/sys/replication/performance/secondary/update-primary

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4