All Products
Search
Document Center

Elasticsearch:Replicate data across clusters with CCR

Last Updated:Jun 02, 2026

Cross-Cluster Replication (CCR) replicates index data from a leader cluster to a follower cluster in near-real time for disaster recovery, read/write splitting, and local access.

How CCR works

Basic architecture

CCR uses an active-passive architecture. The leader cluster handles all writes, and the follower cluster replicates data in read-only mode.

  • leader cluster: The source cluster that accepts all write operations.

  • follower cluster: The destination cluster that is read-only and replicates data from the leader cluster.

Data replication process

CCR data replication consists of two phases:

Initialization phase

The follower cluster requests initialization from the leader, which transfers all Lucene segment files to the follower index, similar to snapshot recovery.

Incremental synchronization phase

By default, follower index shards pull the latest operations from the leader cluster every second:

  1. Determine the pull starting point: The follower cluster maintains a local remote_checkpoint that tracks the latest operation applied to the local index, corresponding to the global_checkpoint in the leader's Translog.

  2. Read from the leader's Translog: The leader uses the from_seq_no from the follower to locate the starting position in the Translog, reads all subsequent operations (index, update, delete), and returns them.

  3. Replay on the follower: The follower replays operations in order and updates its remote_checkpoint. If a replay fails (for example, due to a version conflict), synchronization pauses and logs an error.

  4. Continuous polling: The follower polls for new operations at fixed intervals, achieving sub-second latency.

Translog in CCR

The Translog (transaction log) is the data source for CCR incremental synchronization. It serves these purposes:

  • Prevent data loss: Records all write operations for replay-based recovery after node crashes.

  • Ensure replica consistency: Writes go to the Translog first, then to the replica shard. An operation succeeds only after both primary and replica shards acknowledge it.

  • Support CCR incremental synchronization: CCR reads operation logs through the internal Translog API to retrieve all changes after a specified sequence number for near-real-time replication.

Each shard has its own Translog directory at indices/{index_uuid}/{shard_id}/translog/. Translog files (.tlog) use binary format with a generation mechanism. A new generation file is created on each flush or when the file reaches 512 MB (default).

Network connectivity

Alibaba Cloud Elasticsearch instances run in an independent management VPC, not in a user VPC. Even if two clusters are in the same region or their user VPCs are connected through CEN, they cannot communicate directly over a private network. Use NLB and PrivateLink to connect the management VPCs.

Choose the setup guide based on whether your clusters are in the same region:

Scenario

Description

Documentation

Same region

Both clusters are in the same region. Connect management VPCs with NLB and PrivateLink.

Replicate data within the same region in Alibaba Cloud Elasticsearch

Cross-region

Clusters are in different regions. Connect user VPCs through CEN first, then connect management VPCs with NLB and PrivateLink.

Replicate data across regions in Alibaba Cloud Elasticsearch

Limitations

  • Both clusters must use Cloud-native New Management (v3) mode. If a cluster uses v1 or v2, upgrade it first. Upgrade the architecture of an instance.

    To check your cluster's architecture version, log on to the Elasticsearch console. On the Basic Information page of your instance, view the Control Architecture Type. The mode is either Cloud-native Control Architecture (v3) or Basic Control Architecture (v2).

  • Both clusters must run Elasticsearch 7.10.0 or later. The follower cluster version must be the same as or later than the leader cluster version.

  • The leader and follower indexes must have matching mappings and shard counts. You cannot change the shard count of a follower index.