2018-10-29 09:37:13 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="platinum"]
|
|
|
|
[[ccr-get-stats]]
|
|
|
|
=== Get Cross-Cluster Replication Stats API
|
|
|
|
++++
|
2018-11-20 20:31:01 -05:00
|
|
|
<titleabbrev>Get CCR Stats</titleabbrev>
|
2018-10-29 09:37:13 -04:00
|
|
|
++++
|
|
|
|
|
2018-11-10 14:37:14 -05:00
|
|
|
beta[]
|
|
|
|
|
2018-10-29 09:37:13 -04:00
|
|
|
Get {ccr} stats.
|
|
|
|
|
|
|
|
==== Description
|
|
|
|
|
2018-11-12 10:28:35 -05:00
|
|
|
This API gets {ccr} stats. This API will return all stats related to {ccr}. In
|
|
|
|
particular, this API returns stats about auto-following, and returns the same
|
|
|
|
shard-level stats as in the <<ccr-get-follow-stats,get follower stats API>>.
|
2018-10-29 09:37:13 -04:00
|
|
|
|
|
|
|
==== Request
|
|
|
|
|
2018-11-12 10:28:35 -05:00
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /follower_index/_ccr/follow
|
|
|
|
{
|
|
|
|
"remote_cluster" : "remote_cluster",
|
|
|
|
"leader_index" : "leader_index"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTSETUP
|
|
|
|
// TEST[setup:remote_cluster_and_leader_index]
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST /follower_index/_ccr/pause_follow
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEARDOWN
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_ccr/stats
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
|
|
|
|
==== Results
|
|
|
|
|
|
|
|
This API returns the following information:
|
|
|
|
|
|
|
|
`auto_follow_stats`::
|
|
|
|
(object) an object representing stats for the auto-follow coordinator
|
|
|
|
|
|
|
|
This object consists of the following fields:
|
|
|
|
|
|
|
|
`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
|
|
|
|
|
|
|
|
`auto_follow_stats.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
|
|
|
|
|
|
|
|
`auto_follow_stats.number_of_successful_follow_indices`::
|
|
|
|
(long) the number of indices that the auto-follow coordinator successfully
|
|
|
|
followed
|
|
|
|
|
|
|
|
`auto_follow_stats.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
|
|
|
|
<<ccr-get-follow-stats,get follower stats API>>
|
|
|
|
|
2018-11-21 18:01:59 -05:00
|
|
|
==== Authorization
|
|
|
|
|
|
|
|
If the {es} {security-features} are enabled, you must have `monitor` cluster
|
|
|
|
privileges on the cluster that contains the follower index. For more information,
|
|
|
|
see {stack-ov}/security-privileges.html[Security privileges].
|
|
|
|
|
2018-11-12 10:28:35 -05:00
|
|
|
==== Example
|
|
|
|
|
|
|
|
This example retrieves {ccr} stats:
|
|
|
|
|
2018-10-29 09:37:13 -04:00
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_ccr/stats
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
2018-11-12 10:28:35 -05:00
|
|
|
|
|
|
|
The API returns the following results:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"auto_follow_stats" : {
|
|
|
|
"number_of_failed_follow_indices" : 0,
|
|
|
|
"number_of_failed_remote_cluster_state_requests" : 0,
|
|
|
|
"number_of_successful_follow_indices" : 1,
|
2018-12-17 08:14:56 -05:00
|
|
|
"recent_auto_follow_errors" : [],
|
|
|
|
"auto_followed_clusters" : []
|
2018-11-12 10:28:35 -05:00
|
|
|
},
|
|
|
|
"follow_stats" : {
|
|
|
|
"indices" : [
|
|
|
|
{
|
|
|
|
"index" : "follower_index",
|
|
|
|
"shards" : [
|
|
|
|
{
|
|
|
|
"remote_cluster" : "remote_cluster",
|
|
|
|
"leader_index" : "leader_index",
|
|
|
|
"follower_index" : "follower_index",
|
|
|
|
"shard_id" : 0,
|
|
|
|
"leader_global_checkpoint" : 1024,
|
|
|
|
"leader_max_seq_no" : 1536,
|
|
|
|
"follower_global_checkpoint" : 768,
|
|
|
|
"follower_max_seq_no" : 896,
|
|
|
|
"last_requested_seq_no" : 897,
|
|
|
|
"outstanding_read_requests" : 8,
|
|
|
|
"outstanding_write_requests" : 2,
|
|
|
|
"write_buffer_operation_count" : 64,
|
|
|
|
"follower_mapping_version" : 4,
|
|
|
|
"follower_settings_version" : 2,
|
|
|
|
"total_read_time_millis" : 32768,
|
|
|
|
"total_read_remote_exec_time_millis" : 16384,
|
|
|
|
"successful_read_requests" : 32,
|
|
|
|
"failed_read_requests" : 0,
|
|
|
|
"operations_read" : 896,
|
|
|
|
"bytes_read" : 32768,
|
|
|
|
"total_write_time_millis" : 16384,
|
|
|
|
"write_buffer_size_in_bytes" : 1536,
|
|
|
|
"successful_write_requests" : 16,
|
|
|
|
"failed_write_requests" : 0,
|
|
|
|
"operations_written" : 832,
|
|
|
|
"read_exceptions" : [ ],
|
|
|
|
"time_since_last_read_millis" : 8
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-11-16 04:17:12 -05:00
|
|
|
// TESTRESPONSE[s/"number_of_failed_follow_indices" : 0/"number_of_failed_follow_indices" : $body.auto_follow_stats.number_of_failed_follow_indices/]
|
|
|
|
// TESTRESPONSE[s/"number_of_failed_remote_cluster_state_requests" : 0/"number_of_failed_remote_cluster_state_requests" : $body.auto_follow_stats.number_of_failed_remote_cluster_state_requests/]
|
2018-11-12 10:28:35 -05:00
|
|
|
// TESTRESPONSE[s/"number_of_successful_follow_indices" : 1/"number_of_successful_follow_indices" : $body.auto_follow_stats.number_of_successful_follow_indices/]
|
2018-11-22 08:52:59 -05:00
|
|
|
// TESTRESPONSE[s/"recent_auto_follow_errors" : \[\]/"recent_auto_follow_errors" : $body.auto_follow_stats.recent_auto_follow_errors/]
|
2018-12-17 08:14:56 -05:00
|
|
|
// TESTRESPONSE[s/"auto_followed_clusters" : \[\]/"auto_followed_clusters" : $body.auto_follow_stats.auto_followed_clusters/]
|
2018-11-12 10:28:35 -05:00
|
|
|
// TESTRESPONSE[s/"leader_global_checkpoint" : 1024/"leader_global_checkpoint" : $body.follow_stats.indices.0.shards.0.leader_global_checkpoint/]
|
|
|
|
// TESTRESPONSE[s/"leader_max_seq_no" : 1536/"leader_max_seq_no" : $body.follow_stats.indices.0.shards.0.leader_max_seq_no/]
|
|
|
|
// TESTRESPONSE[s/"follower_global_checkpoint" : 768/"follower_global_checkpoint" : $body.follow_stats.indices.0.shards.0.follower_global_checkpoint/]
|
|
|
|
// TESTRESPONSE[s/"follower_max_seq_no" : 896/"follower_max_seq_no" : $body.follow_stats.indices.0.shards.0.follower_max_seq_no/]
|
|
|
|
// TESTRESPONSE[s/"last_requested_seq_no" : 897/"last_requested_seq_no" : $body.follow_stats.indices.0.shards.0.last_requested_seq_no/]
|
|
|
|
// TESTRESPONSE[s/"outstanding_read_requests" : 8/"outstanding_read_requests" : $body.follow_stats.indices.0.shards.0.outstanding_read_requests/]
|
|
|
|
// TESTRESPONSE[s/"outstanding_write_requests" : 2/"outstanding_write_requests" : $body.follow_stats.indices.0.shards.0.outstanding_write_requests/]
|
|
|
|
// TESTRESPONSE[s/"write_buffer_operation_count" : 64/"write_buffer_operation_count" : $body.follow_stats.indices.0.shards.0.write_buffer_operation_count/]
|
|
|
|
// TESTRESPONSE[s/"follower_mapping_version" : 4/"follower_mapping_version" : $body.follow_stats.indices.0.shards.0.follower_mapping_version/]
|
|
|
|
// TESTRESPONSE[s/"follower_settings_version" : 2/"follower_settings_version" : $body.follow_stats.indices.0.shards.0.follower_settings_version/]
|
|
|
|
// TESTRESPONSE[s/"total_read_time_millis" : 32768/"total_read_time_millis" : $body.follow_stats.indices.0.shards.0.total_read_time_millis/]
|
|
|
|
// TESTRESPONSE[s/"total_read_remote_exec_time_millis" : 16384/"total_read_remote_exec_time_millis" : $body.follow_stats.indices.0.shards.0.total_read_remote_exec_time_millis/]
|
|
|
|
// TESTRESPONSE[s/"successful_read_requests" : 32/"successful_read_requests" : $body.follow_stats.indices.0.shards.0.successful_read_requests/]
|
|
|
|
// TESTRESPONSE[s/"failed_read_requests" : 0/"failed_read_requests" : $body.follow_stats.indices.0.shards.0.failed_read_requests/]
|
|
|
|
// TESTRESPONSE[s/"operations_read" : 896/"operations_read" : $body.follow_stats.indices.0.shards.0.operations_read/]
|
|
|
|
// TESTRESPONSE[s/"bytes_read" : 32768/"bytes_read" : $body.follow_stats.indices.0.shards.0.bytes_read/]
|
|
|
|
// TESTRESPONSE[s/"total_write_time_millis" : 16384/"total_write_time_millis" : $body.follow_stats.indices.0.shards.0.total_write_time_millis/]
|
|
|
|
// TESTRESPONSE[s/"write_buffer_size_in_bytes" : 1536/"write_buffer_size_in_bytes" : $body.follow_stats.indices.0.shards.0.write_buffer_size_in_bytes/]
|
|
|
|
// TESTRESPONSE[s/"successful_write_requests" : 16/"successful_write_requests" : $body.follow_stats.indices.0.shards.0.successful_write_requests/]
|
|
|
|
// TESTRESPONSE[s/"failed_write_requests" : 0/"failed_write_requests" : $body.follow_stats.indices.0.shards.0.failed_write_requests/]
|
|
|
|
// TESTRESPONSE[s/"operations_written" : 832/"operations_written" : $body.follow_stats.indices.0.shards.0.operations_written/]
|
|
|
|
// TESTRESPONSE[s/"time_since_last_read_millis" : 8/"time_since_last_read_millis" : $body.follow_stats.indices.0.shards.0.time_since_last_read_millis/]
|