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, make sure that non-admin users are mapped to the appropriate permissions so they can 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 that are configured on a cluster, send the following request:

    To delete a replication rule, send the following request to the follower cluster:

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