Link Search Menu Expand Document Documentation Menu

远程存储统计 API

2.8 版本引入

使用远程存储统计 API 监控分片级远程支持存储的性能。

此 API 返回的指标仅与存储在远程支持节点上的索引相关。要获取节点或集群级别索引的聚合输出,请使用 索引统计节点统计集群统计 API。

端点

GET _remotestore/stats/<index_name>
GET _remotestore/stats/<index_name>/<shard_id>

路径参数

下表列出了可用的路径参数。所有路径参数均为可选。

参数 类型 描述
index_name 字符串 索引名称或索引模式。
shard_id 字符串 分片 ID。

索引的远程存储统计

使用以下 API 获取所有索引分片的远程存储统计信息。

请求示例

GET _remotestore/stats/<index_name>

示例响应

响应
{
    "_shards": {
        "total": 4,
        "successful": 4,
        "failed": 0
    },
    "indices": {
        "remote-index": {
            "shards": {
                "0": [{
                        "routing": {
                            "state": "STARTED",
                            "primary": true,
                            "node": "q1VxWZnCTICrfRc2bRW3nw"
                        },
                        "segment": {
                            "download": {},
                            "upload": {
                                "local_refresh_timestamp_in_millis": 1694171634102,
                                "remote_refresh_timestamp_in_millis": 1694171634102,
                                "refresh_time_lag_in_millis": 0,
                                "refresh_lag": 0,
                                "bytes_lag": 0,
                                "backpressure_rejection_count": 0,
                                "consecutive_failure_count": 0,
                                "total_uploads": {
                                    "started": 5,
                                    "succeeded": 5,
                                    "failed": 0
                                },
                                "total_upload_size": {
                                    "started_bytes": 15342,
                                    "succeeded_bytes": 15342,
                                    "failed_bytes": 0
                                },
                                "remote_refresh_size_in_bytes": {
                                    "last_successful": 0,
                                    "moving_avg": 3068.4
                                },
                                "upload_speed_in_bytes_per_sec": {
                                    "moving_avg": 99988.2
                                },
                                "remote_refresh_latency_in_millis": {
                                    "moving_avg": 44.0
                                }
                            }
                        },
                        "translog": {
                            "upload": {
                                "last_successful_upload_timestamp": 1694171633644,
                                "total_uploads": {
                                    "started": 6,
                                    "failed": 0,
                                    "succeeded": 6
                                },
                                "total_upload_size": {
                                    "started_bytes": 1932,
                                    "failed_bytes": 0,
                                    "succeeded_bytes": 1932
                                },
                                "total_upload_time_in_millis": 21478,
                                "upload_size_in_bytes": {
                                    "moving_avg": 322.0
                                },
                                "upload_speed_in_bytes_per_sec": {
                                    "moving_avg": 2073.8333333333335
                                },
                                "upload_time_in_millis": {
                                    "moving_avg": 3579.6666666666665
                                }
                            },
                            "download": {}
                        }
                    },
                    {
                        "routing": {
                            "state": "STARTED",
                            "primary": false,
                            "node": "EZuen5Y5Sv-eDCLwh9gv-Q"
                        },
                        "segment": {
                            "download": {
                                "last_sync_timestamp": 1694171634148,
                                "total_download_size": {
                                    "started_bytes": 15112,
                                    "succeeded_bytes": 15112,
                                    "failed_bytes": 0
                                },
                                "download_size_in_bytes": {
                                    "last_successful": 2910,
                                    "moving_avg": 1259.3333333333333
                                },
                                "download_speed_in_bytes_per_sec": {
                                    "moving_avg": 382387.3333333333
                                }
                            },
                            "upload": {}
                        },
                        "translog": {
                            "upload": {},
                            "download": {}
                        }
                    }
                ],
                "1": [{
                        "routing": {
                            "state": "STARTED",
                            "primary": false,
                            "node": "q1VxWZnCTICrfRc2bRW3nw"
                        },
                        "segment": {
                            "download": {
                                "last_sync_timestamp": 1694171633181,
                                "total_download_size": {
                                    "started_bytes": 18978,
                                    "succeeded_bytes": 18978,
                                    "failed_bytes": 0
                                },
                                "download_size_in_bytes": {
                                    "last_successful": 325,
                                    "moving_avg": 1265.2
                                },
                                "download_speed_in_bytes_per_sec": {
                                    "moving_avg": 456047.6666666667
                                }
                            },
                            "upload": {}
                        },
                        "translog": {
                            "upload": {},
                            "download": {}
                        }
                    },
                    {
                        "routing": {
                            "state": "STARTED",
                            "primary": true,
                            "node": "EZuen5Y5Sv-eDCLwh9gv-Q"
                        },
                        "segment": {
                            "download": {},
                            "upload": {
                                "local_refresh_timestamp_in_millis": 1694171633122,
                                "remote_refresh_timestamp_in_millis": 1694171633122,
                                "refresh_time_lag_in_millis": 0,
                                "refresh_lag": 0,
                                "bytes_lag": 0,
                                "backpressure_rejection_count": 0,
                                "consecutive_failure_count": 0,
                                "total_uploads": {
                                    "started": 6,
                                    "succeeded": 6,
                                    "failed": 0
                                },
                                "total_upload_size": {
                                    "started_bytes": 19208,
                                    "succeeded_bytes": 19208,
                                    "failed_bytes": 0
                                },
                                "remote_refresh_size_in_bytes": {
                                    "last_successful": 0,
                                    "moving_avg": 3201.3333333333335
                                },
                                "upload_speed_in_bytes_per_sec": {
                                    "moving_avg": 109612.0
                                },
                                "remote_refresh_latency_in_millis": {
                                    "moving_avg": 25.333333333333332
                                }
                            }
                        },
                        "translog": {
                            "upload": {
                                "last_successful_upload_timestamp": 1694171633106,
                                "total_uploads": {
                                    "started": 7,
                                    "failed": 0,
                                    "succeeded": 7
                                },
                                "total_upload_size": {
                                    "started_bytes": 2405,
                                    "failed_bytes": 0,
                                    "succeeded_bytes": 2405
                                },
                                "total_upload_time_in_millis": 27748,
                                "upload_size_in_bytes": {
                                    "moving_avg": 343.57142857142856
                                },
                                "upload_speed_in_bytes_per_sec": {
                                    "moving_avg": 1445.857142857143
                                },
                                "upload_time_in_millis": {
                                    "moving_avg": 3964.0
                                }
                            },
                            "download": {}
                        }
                    }
                ]
            }
        }
    }
}

响应正文字段

远程存储统计 API 的响应主体分为三类

  • routing:包含与分片路由相关的信息
  • segment:包含与从远程支持存储传输段相关的统计信息
  • translog:包含与从远程支持存储传输事务日志相关的统计信息

路由

routing 对象包含以下字段。

字段 描述
primary 表示分片副本是否为主分片。
node 分片分配到的节点名称。

segment.upload 对象包含以下字段。

字段 描述
local_refresh_timestamp_in_millis 最后一次成功的本地刷新时间戳,单位为毫秒。
remote_refresh_timestamp_in_millis 最后一次成功的远程刷新时间戳,单位为毫秒。
refresh_time_lag_in_millis 远程刷新落后于本地刷新的时间量,单位为毫秒。
refresh_lag 远程存储落后于本地存储的刷新次数。
bytes_lag 远程和本地存储之间的滞后字节数。
backpressure_rejection_count 由于远程存储中的背压而导致的写入拒绝总数。
consecutive_failure_count 自上次成功刷新以来连续远程刷新失败的次数。
total_remote_refresh 远程刷新的总次数。
total_uploads_in_bytes 上传到远程存储的所有上传数据的总字节数。
remote_refresh_size_in_bytes.last_successful 上次成功刷新期间上传的数据大小。
remote_refresh_size_in_bytes.moving_avg 在最后 *N* 次刷新中上传的数据的平均大小(以字节为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。有关更多信息,请参阅远程段背压
upload_latency_in_bytes_per_sec.moving_avg 在最后 *N* 次上传中,远程段上传的平均速度(以字节/秒为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。有关更多信息,请参阅远程段背压
remote_refresh_latency_in_millis.moving_avg 在最后 *N* 次远程刷新期间,单次远程刷新所花费的平均时间(以毫秒为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。有关更多信息,请参阅远程段背压

segment.download 对象包含以下字段。

字段 描述
last_sync_timestamp 自上次成功从远程支持存储下载段文件以来的时间戳,单位为毫秒。
total_download_size.started_bytes 正在从远程支持存储主动下载的段文件的总字节数。
total_download_size.succeeded_bytes 从远程支持存储成功下载的段文件的总字节数。
total_download_size.failed_bytes 从远程支持存储下载失败的段文件的总字节数。
download_size_in_bytes.last_successful 最后一次成功从远程支持存储下载的段文件的大小,单位为字节。
download_size_in_bytes.moving_avg 最后 20 次下载中段数据的平均大小,单位为字节。
download_speed_in_bytes_per_sec.moving_avg 最后 20 次下载的平均下载速度,单位为字节/秒。

事务日志

translog.upload 对象包含以下字段。

字段 描述
last_successful_upload_timestamp 自上次事务日志文件成功上传到远程支持存储以来的时间戳,单位为毫秒。
total_uploads.started 尝试将事务日志同步上传到远程支持存储的总次数。
total_uploads.failed 事务日志同步上传到远程支持存储失败的总次数。
total_uploads.succeeded 事务日志同步上传到远程支持存储成功的总次数。
total_upload_size.started_bytes 正在主动上传到远程支持存储的事务日志文件的总字节数。
total_upload_size.succeeded_bytes 成功上传到远程支持存储的事务日志文件的总字节数。
total_upload_size.failed_bytes 上传到远程支持存储失败的事务日志文件的总字节数。
total_upload_time_in_millis 上传事务日志文件到远程支持存储所花费的总时间,单位为毫秒。
upload_size_in_bytes.moving_avg 在最后 *N* 次上传中,事务日志数据的平均大小(以字节为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。
upload_speed_in_bytes_per_sec.moving_avg 在最后 *N* 次上传中,事务日志上传的平均速度(以字节/秒为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。
upload_time_in_millis.moving_avg 自最后 *N* 次上传以来,单次事务日志上传所花费的平均时间(以毫秒为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。

translog.download 对象包含以下字段。

字段 描述
last_successful_download_timestamp 自上次事务日志文件成功上传到远程支持存储以来的时间戳,单位为毫秒。
total_downloads.succeeded 从远程支持存储成功同步下载事务日志的总次数。
total_download_size.succeeded_bytes 成功从远程支持存储下载的事务日志文件的总字节数。
total_download_time_in_millis 从远程支持存储下载事务日志文件所花费的总时间,单位为毫秒。
download_size_in_bytes.moving_avg 在最后 *N* 次下载中下载的事务日志数据的平均大小(以字节为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。
download_speed_in_bytes_per_sec.moving_avg 在最后 *N* 次下载中,事务日志下载的平均速度(以字节/秒为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。
download_time_in_millis.moving_avg 自最后 *N* 次下载以来,单次事务日志下载所花费的平均时间(以毫秒为单位)。*N* 在 remote_store.moving_average_window_size 设置中定义。

单个分片的远程存储统计

使用以下 API 获取单个分片的远程存储统计信息。

请求示例

GET _remotestore/stats/<index_name>/<shard_id>

示例响应

响应
{
    "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
    },
    "indices": {
        "remote-index": {
            "shards": {
                "0": [
                    {
                        "routing": {
                            "state": "STARTED",
                            "primary": true,
                            "node": "q1VxWZnCTICrfRc2bRW3nw"
                        },
                        "segment": {
                            "download": {},
                            "upload": {
                                "local_refresh_timestamp_in_millis": 1694171634102,
                                "remote_refresh_timestamp_in_millis": 1694171634102,
                                "refresh_time_lag_in_millis": 0,
                                "refresh_lag": 0,
                                "bytes_lag": 0,
                                "backpressure_rejection_count": 0,
                                "consecutive_failure_count": 0,
                                "total_uploads": {
                                    "started": 5,
                                    "succeeded": 5,
                                    "failed": 0
                                },
                                "total_upload_size": {
                                    "started_bytes": 15342,
                                    "succeeded_bytes": 15342,
                                    "failed_bytes": 0
                                },
                                "remote_refresh_size_in_bytes": {
                                    "last_successful": 0,
                                    "moving_avg": 3068.4
                                },
                                "upload_speed_in_bytes_per_sec": {
                                    "moving_avg": 99988.2
                                },
                                "remote_refresh_latency_in_millis": {
                                    "moving_avg": 44.0
                                }
                            }
                        },
                        "translog": {
                            "upload": {
                                "last_successful_upload_timestamp": 1694171633644,
                                "total_uploads": {
                                    "started": 6,
                                    "failed": 0,
                                    "succeeded": 6
                                },
                                "total_upload_size": {
                                    "started_bytes": 1932,
                                    "failed_bytes": 0,
                                    "succeeded_bytes": 1932
                                },
                                "total_upload_time_in_millis": 21478,
                                "upload_size_in_bytes": {
                                    "moving_avg": 322.0
                                },
                                "upload_speed_in_bytes_per_sec": {
                                    "moving_avg": 2073.8333333333335
                                },
                                "upload_time_in_millis": {
                                    "moving_avg": 3579.6666666666665
                                }
                            },
                            "download": {}
                        }
                    },
                    {
                        "routing": {
                            "state": "STARTED",
                            "primary": false,
                            "node": "EZuen5Y5Sv-eDCLwh9gv-Q"
                        },
                        "segment": {
                            "download": {
                                "last_sync_timestamp": 1694171634148,
                                "total_download_size": {
                                    "started_bytes": 15112,
                                    "succeeded_bytes": 15112,
                                    "failed_bytes": 0
                                },
                                "download_size_in_bytes": {
                                    "last_successful": 2910,
                                    "moving_avg": 1259.3333333333333
                                },
                                "download_speed_in_bytes_per_sec": {
                                    "moving_avg": 382387.3333333333
                                }
                            },
                            "upload": {}
                        },
                        "translog": {
                            "upload": {},
                            "download": {}
                        }
                    }
                ]
            }
        }
    }
}

本地分片的远程存储统计

如果要仅获取服务远程存储统计 API 请求的节点上存在的分片,请将 local 查询参数设置为 true,如以下示例请求所示

GET _remotestore/stats/<index_name>?local=true

剩余 350 字符

有问题?

想贡献?