{{#if (not (has-feature "DR Replication"))}} {{upgrade-page title="Replication"}} {{else if (or cluster.allReplicationDisabled cluster.replicationAttrs.replicationDisabled)}}

{{#if initialReplicationMode}} {{#if (eq initialReplicationMode 'dr')}} Enable Disaster Recovery Replication {{else if (eq initialReplicationMode 'performance')}} Enable Performance Replication {{/if}} {{else}} Enable Replication {{/if}}

{{message-error errors=errors}} {{#if initialReplicationMode}} {{#if (eq initialReplicationMode 'dr')}}

DR is designed to protect against catastrophic failure of entire clusters. Secondaries do not forward service requests (until they are elected and become a new primary).

{{else if (eq initialReplicationMode 'performance')}}

{{#if (not (has-feature "Performance Replication"))}}

Performance Replication is a feature of Vault Enterprise Premium

{{else}}

Performance replication scales workloads horizontally across clusters to make requests faster. Local secondaries handle read requests but forward writes to the primary to be handled.

{{/if}} {{/if}} {{else}}

In both Performance and Disaster Recovery (DR) Replication, secondaries share the underlying configuration, policies, and supporting secrets as their primary cluster.

{{/if}}
{{#if (eq mode 'secondary')}} {{/if}}
{{#if (eq mode 'primary')}} {{#if cluster.canEnablePrimary}}
{{input class="input" id="primary_cluster_addr" name="primary_cluster_addr" value=primary_cluster_addr}}

Overrides the cluster address that the primary gives to secondary nodes.

{{else}}

The token you are using is not authorized to enable primary replication.

{{/if}} {{else}} {{#if cluster.canEnableSecondary}} {{#if (and (eq replicationMode 'dr') (not cluster.performance.replicationDisabled) (has-feature "Performance Replication") ) }}
{{toggle-button toggleTarget=this toggleAttr='showExplanation' openLabel="Disable Performance Replication in order to enable this cluster as a DR secondary." closedLabel="Disable Performance Replication in order to enable this cluster as a DR secondary." class="has-text-danger" }} {{#if showExplanation}}

When running as a DR Secondary Vault is read only. For this reason, we don't allow other Replication modes to operate at the same time. This cluster is also currently operating as a Performance {{capitalize cluster.performance.modeForUrl}}.

{{/if}}
{{else}}
{{textarea value=token id="secondary-token" name="secondary-token" class="textarea"}}
{{input value=primary_api_addr id="primary_api_addr" name="primary_api_addr" class="input"}}

{{#if (and token (not tokenIncludesAPIAddr))}} The supplied token does not contain an embedded address for the primary cluster. Please enter the primary cluster's API address (normal Vault address). {{else}} Set this to the API address (normal Vault address) to override the value embedded in the token. {{/if}}

{{input value=ca_file id="ca_file" name="ca_file" class="input"}}

Specifies the path to a CA root file (PEM format) that the secondary can use when unwrapping the token from the primary.

{{input value=ca_path id="ca_path" name="ca_file" class="input"}}

Specifies the path to a CA root directory containing PEM-format files that the secondary can use when unwrapping the token from the primary.

Note: If both CA file and CA path are not given, they default to system CA roots.

{{/if}} {{else}}

The token you are using is not authorized to enable secondary replication.

{{/if}} {{/if}}
{{#if (or (and (eq mode 'primary') cluster.canEnablePrimary) (and (eq mode 'secondary') cluster.canEnableSecondary))}}
{{/if}}
{{else if showModeSummary}}

Replication

{{#if cluster.dr.replicationEnabled}} {{#link-to "mode.index" "dr" class="link-plain" }} {{replication-mode-summary mode="dr" cluster=cluster tagName="span" }} {{/link-to}} {{else}} {{replication-mode-summary mode="dr" cluster=cluster tagName="div" }} {{/if}}

{{#if cluster.dr.replicationEnabled}} {{#link-to "mode.index" "performance" class="link-plain" }} {{replication-mode-summary mode="performance" cluster=cluster tagName="span" }} {{/link-to}} {{else}} {{replication-mode-summary mode="performance" cluster=cluster tagName="div" }} {{/if}}
{{else}} {{#if (eq replicationAttrs.mode 'initializing')}} The cluster is initializing replication. This may take some time. {{else}} {{info-table-row label="Mode" value=replicationAttrs.mode}} {{info-table-row label="Replication set" value=replicationAttrs.clusterId}} {{info-table-row label="Secondary ID" value=replicationAttrs.secondaryId}} {{info-table-row label="State" value=replicationAttrs.state}} {{info-table-row label="Primary cluster address" value=replicationAttrs.primaryClusterAddr}} {{info-table-row label="Replication state" value=replicationAttrs.replicationState}} {{info-table-row label="Last WAL entry" value=replicationAttrs.lastWAL}} {{info-table-row label="Last Remote WAL entry" value=replicationAttrs.lastRemoteWAL}} {{info-table-row label="Merkle root index" value=replicationAttrs.merkleRoot}} {{#if replicationAttrs.syncProgress}} {{info-table-row label="Sync progress" value=(concat replicationAttrs.syncProgress.progress '/' replicationAttrs.syncProgress.total)}} {{/if}} {{/if}} {{/if}}