Get cross-cluster replication stats API

Get cross-cluster replication stats.

Request

  1. GET /_ccr/stats

Prerequisites

  • If the Elasticsearch security features are enabled, you must have monitor cluster privileges on the cluster that contains the follower index. For more information, see Security privileges.

Description

This API gets cross-cluster replication stats. This API will return all stats related to cross-cluster replication. In particular, this API returns stats about auto-following, and returns the same shard-level stats as in the get follower stats API.

Response body

auto_follow_stats

(object) An object representing stats for the auto-follow coordinator.

Properties of auto_follow_stats

  • number_of_failed_follow_indices

    (long) The number of indices that the auto-follow coordinator failed to automatically follow. The causes of recent failures are captured in the logs of the elected master node and in the auto_follow_stats.recent_auto_follow_errors field.

    number_of_failed_remote_cluster_state_requests

    (long) The number of times that the auto-follow coordinator failed to retrieve the cluster state from a remote cluster registered in a collection of auto-follow patterns.

    number_of_successful_follow_indices

    (long) The number of indices that the auto-follow coordinator successfully followed.

    recent_auto_follow_errors

    (array) An array of objects representing failures by the auto-follow coordinator.

follow_stats

(object) An object representing shard-level stats for follower indices; refer to the details of the response in the get follower stats API.

Examples

This example retrieves cross-cluster replication stats:

  1. GET /_ccr/stats

The API returns the following results:

  1. {
  2. "auto_follow_stats" : {
  3. "number_of_failed_follow_indices" : 0,
  4. "number_of_failed_remote_cluster_state_requests" : 0,
  5. "number_of_successful_follow_indices" : 1,
  6. "recent_auto_follow_errors" : [],
  7. "auto_followed_clusters" : []
  8. },
  9. "follow_stats" : {
  10. "indices" : [
  11. {
  12. "index" : "follower_index",
  13. "shards" : [
  14. {
  15. "remote_cluster" : "remote_cluster",
  16. "leader_index" : "leader_index",
  17. "follower_index" : "follower_index",
  18. "shard_id" : 0,
  19. "leader_global_checkpoint" : 1024,
  20. "leader_max_seq_no" : 1536,
  21. "follower_global_checkpoint" : 768,
  22. "follower_max_seq_no" : 896,
  23. "last_requested_seq_no" : 897,
  24. "outstanding_read_requests" : 8,
  25. "outstanding_write_requests" : 2,
  26. "write_buffer_operation_count" : 64,
  27. "follower_mapping_version" : 4,
  28. "follower_settings_version" : 2,
  29. "follower_aliases_version" : 8,
  30. "total_read_time_millis" : 32768,
  31. "total_read_remote_exec_time_millis" : 16384,
  32. "successful_read_requests" : 32,
  33. "failed_read_requests" : 0,
  34. "operations_read" : 896,
  35. "bytes_read" : 32768,
  36. "total_write_time_millis" : 16384,
  37. "write_buffer_size_in_bytes" : 1536,
  38. "successful_write_requests" : 16,
  39. "failed_write_requests" : 0,
  40. "operations_written" : 832,
  41. "read_exceptions" : [ ],
  42. "time_since_last_read_millis" : 8
  43. }
  44. ]
  45. }
  46. ]
  47. }
  48. }