Create Sync Relationship

After creating remote cluster, users can create sync relationship for table in source cluster. During this process, Hippo will clone the source table into target cluster firstly, then all the incoming write operations against source table will be synced to target table in remote cluster in real-time.

📘

Kindly note

  • All existing tables will be copied to target table.
  • Sync relationship has nothing to do with the indexes of tables in source and remote clusters. Indexes will be maintained separately, thus all add/drop operations against source table will not be synced to remote table, vice versa.
curl -u shiva:shiva -XPUT 'localhost:8902/hippo/v1/_ccr/create_relation?pretty' -H 'Content-Type: application/json' -d'{
  "ccr_relation_name" : "book_ccr",
  "remote_cluster_name" : "cluster1",
  "source_table" : {
    "database_name" : "default",
    "table_name" : "book"
  },
  "dest_table" : {
    "database_name" : "default",
    "table_name" : "book_backup"
  }
}';

Result:

{
  "acknowledged" : true
}

Parameter description:

ParametersDescriptionRequired
ccr_relation_nameRelationship nameYes
remote_cluster_nameRemote cluster nameYes
database_name (source_table)Source database nameNo, defaults to "default" database
table_name (source_table)Source table nameYes
database_name (dest_table)Destination database nameNo, defaults to "default" database
table_name (dest_table)Destination table nameYes
Table 49 Create Sync Relationship (Restful API)