Cross cluster replication not started

Hi @Mantas

Can you please look into this.

Hi @Mantas,

I hope you’re doing well.

I have successfully set up replication for multiple indices. Now, I need to replicate indices that match two specific patterns within a single auto-follow rule. I want to include an array of patterns in the API call.

Here is my current API call:

curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{
   "leader_alias" : "my-connection-alias",
   "name": "my-replication-rule",
   "pattern": "movies*",
   "use_roles":{
      "leader_cluster_role": "all_access",
      "follower_cluster_role": "all_access"
   }
}'

I need to modify this to include two patterns:

  1. esdl-alerts*
  2. esdl-archives*

Could you please guide me on how to modify the API call to handle these two patterns?

Best regard

Hi @sahunikita1609,

Have you tried passing a list like per below:

curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{
   "leader_alias" : "my-connection-alias",
   "name": "my-replication-rule",
   "pattern": [
     "esdl-alerts*", 
     "esdl-archives*"
    ],
   "use_roles":{
      "leader_cluster_role": "all_access",
      "follower_cluster_role": "all_access"
   }
}'

Best,
mj

Hi @Mantas,

I have tried this already but I get the error

best regard

what does the error say?

best,
mj

oh, I see the use of “*” breaks it, you need to create separate _autofollow for each index pattern.


curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{
  "leader_alias": "my-connection-alias",
  "name": "esdl-alerts-replication-rule",
  "pattern": "esdl-alerts*",
  "use_roles": {
    "leader_cluster_role": "all_access",
    "follower_cluster_role": "all_access"
  }
}'
curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{
  "leader_alias": "my-connection-alias",
  "name": "esdl-archives-replication-rule",
  "pattern": "esdl-archives*",
  "use_roles": {
    "leader_cluster_role": "all_access",
    "follower_cluster_role": "all_access"
  }
}'

best,
mj