Auto-follow for cross-cluster replication

    You can configure multiple replication rules for a single cluster. The patterns currently only support wildcard matching.

    You need to set up a cross-cluster connection between two clusters before you can enable auto-follow.

    If the security plugin is enabled, non-admin users need to be mapped to the appropriate permissions in order to perform replication actions. For index and cluster-level permissions requirements, see .

    Create a replication rule on the follower cluster:

    If the security plugin is disabled, you can leave out the use_roles parameter. If it’s enabled, however, you need to specify the leader and follower cluster roles that OpenSearch uses to authenticate requests. This example uses all_access for simplicity, but we recommend creating a replication user on each cluster and mapping it accordingly.

    To test the rule, create a matching index on the leader cluster:

    It might take several seconds for the index to appear.

    1. health status index uuid pri rep docs.count docs.deleted store.size pri.store.size

    To retrieve a list of existing replication rules configured on a cluster, send the following request:

    When you delete a replication rule, OpenSearch stops replicating new indices that match the pattern, but existing indices that the rule previously created continue to replicate. If you need to stop existing replication activity, use the .

    1. {
    2. "leader_alias" : "my-conection-alias",
    3. }'