Cross-Cluster Replication (CCR)
- class elasticsearch.client.CcrClient(client)
- Parameters:
client (BaseClient)
- delete_auto_follow_pattern(*, name, error_trace=None, filter_path=None, human=None, pretty=None)
Deletes auto-follow patterns.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-delete-auto-follow-pattern.html
- follow(*, index, error_trace=None, filter_path=None, human=None, leader_index=None, max_outstanding_read_requests=None, max_outstanding_write_requests=None, max_read_request_operation_count=None, max_read_request_size=None, max_retry_delay=None, max_write_buffer_count=None, max_write_buffer_size=None, max_write_request_operation_count=None, max_write_request_size=None, pretty=None, read_poll_timeout=None, remote_cluster=None, wait_for_active_shards=None, body=None)
Creates a new follower index configured to follow the referenced leader index.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-put-follow.html
- Parameters:
index (str) – The name of the follower index
leader_index (str | None)
max_outstanding_read_requests (int | None)
max_outstanding_write_requests (int | None)
max_read_request_operation_count (int | None)
max_read_request_size (str | None)
max_retry_delay (str | Literal[-1] | ~typing.Literal[0] | None)
max_write_buffer_count (int | None)
max_write_buffer_size (str | None)
max_write_request_operation_count (int | None)
max_write_request_size (str | None)
read_poll_timeout (str | Literal[-1] | ~typing.Literal[0] | None)
remote_cluster (str | None)
wait_for_active_shards (int | str | Literal['all', 'index-setting'] | None) – Sets the number of shard copies that must be active before returning. Defaults to 0. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- follow_info(*, index, error_trace=None, filter_path=None, human=None, pretty=None)
Retrieves information about all follower indices, including parameters and status for each follower index
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-get-follow-info.html
- follow_stats(*, index, error_trace=None, filter_path=None, human=None, pretty=None)
Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-get-follow-stats.html
- forget_follower(*, index, error_trace=None, filter_path=None, follower_cluster=None, follower_index=None, follower_index_uuid=None, human=None, leader_remote_cluster=None, pretty=None, body=None)
Removes the follower retention leases from the leader.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-post-forget-follower.html
- Parameters:
- Return type:
- get_auto_follow_pattern(*, name=None, error_trace=None, filter_path=None, human=None, pretty=None)
Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-get-auto-follow-pattern.html
- Parameters:
- Return type:
- pause_auto_follow_pattern(*, name, error_trace=None, filter_path=None, human=None, pretty=None)
Pauses an auto-follow pattern
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-pause-auto-follow-pattern.html
- pause_follow(*, index, error_trace=None, filter_path=None, human=None, pretty=None)
Pauses a follower index. The follower index will not fetch any additional operations from the leader index.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-post-pause-follow.html
- put_auto_follow_pattern(*, name, remote_cluster=None, error_trace=None, filter_path=None, follow_index_pattern=None, human=None, leader_index_exclusion_patterns=None, leader_index_patterns=None, max_outstanding_read_requests=None, max_outstanding_write_requests=None, max_read_request_operation_count=None, max_read_request_size=None, max_retry_delay=None, max_write_buffer_count=None, max_write_buffer_size=None, max_write_request_operation_count=None, max_write_request_size=None, pretty=None, read_poll_timeout=None, settings=None, body=None)
Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-put-auto-follow-pattern.html
- Parameters:
name (str) – The name of the collection of auto-follow patterns.
remote_cluster (str | None) – The remote cluster containing the leader indices to match against.
follow_index_pattern (str | None) – The name of follower index. The template {{leader_index}} can be used to derive the name of the follower index from the name of the leader index. When following a data stream, use {{leader_index}}; CCR does not support changes to the names of a follower data stream’s backing indices.
leader_index_exclusion_patterns (Sequence[str] | None) – An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or more leader_index_patterns and one or more leader_index_exclusion_patterns won’t be followed.
leader_index_patterns (Sequence[str] | None) – An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field.
max_outstanding_read_requests (int | None) – The maximum number of outstanding reads requests from the remote cluster.
max_outstanding_write_requests (int | None) – The maximum number of outstanding reads requests from the remote cluster.
max_read_request_operation_count (int | None) – The maximum number of operations to pull per read from the remote cluster.
max_read_request_size (int | str | None) – The maximum size in bytes of per read of a batch of operations pulled from the remote cluster.
max_retry_delay (str | Literal[-1] | ~typing.Literal[0] | None) – The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying.
max_write_buffer_count (int | None) – The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit.
max_write_buffer_size (int | str | None) – The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit.
max_write_request_operation_count (int | None) – The maximum number of operations per bulk write request executed on the follower.
max_write_request_size (int | str | None) – The maximum total bytes of operations per bulk write request executed on the follower.
read_poll_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again.
settings (Mapping[str, Any] | None) – Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards).
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- resume_auto_follow_pattern(*, name, error_trace=None, filter_path=None, human=None, pretty=None)
Resumes an auto-follow pattern that has been paused
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-resume-auto-follow-pattern.html
- resume_follow(*, index, error_trace=None, filter_path=None, human=None, max_outstanding_read_requests=None, max_outstanding_write_requests=None, max_read_request_operation_count=None, max_read_request_size=None, max_retry_delay=None, max_write_buffer_count=None, max_write_buffer_size=None, max_write_request_operation_count=None, max_write_request_size=None, pretty=None, read_poll_timeout=None, body=None)
Resumes a follower index that has been paused
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-post-resume-follow.html
- Parameters:
index (str) – The name of the follow index to resume following.
max_outstanding_read_requests (int | None)
max_outstanding_write_requests (int | None)
max_read_request_operation_count (int | None)
max_read_request_size (str | None)
max_retry_delay (str | Literal[-1] | ~typing.Literal[0] | None)
max_write_buffer_count (int | None)
max_write_buffer_size (str | None)
max_write_request_operation_count (int | None)
max_write_request_size (str | None)
read_poll_timeout (str | Literal[-1] | ~typing.Literal[0] | None)
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- stats(*, error_trace=None, filter_path=None, human=None, pretty=None)
Gets all stats related to cross-cluster replication.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-get-stats.html
- unfollow(*, index, error_trace=None, filter_path=None, human=None, pretty=None)
Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/ccr-post-unfollow.html