etcd 基础14

2022-01-20 11:00:20 浏览数 (1)

统计

etcd集群对延时,带宽,和运行时间都有统计,通过统计信息,可以了解集群内部的健康状态

leader统计信息

主节点拥有整个集群的视野,主要关心两类信息

  • 到每个节点的延时
  • 成功和失败的Raft RPC请求
代码语言:javascript复制
[root@docker ~]# curl http://127.0.0.1:2379/v2/stats/leader
{"leader":"ce2a822cea30bfca","followers":{}}[root@docker ~]# 
[root@docker ~]#  

我的环境中还没有followers,所以是空的

下面是官方文档中的示例

curl http://127.0.0.1:2379/v2/stats/leader

代码语言:javascript复制
{
    "followers": {
        "6e3bd23ae5f1eae0": {
            "counts": {
                "fail": 0,
                "success": 745
            },
            "latency": {
                "average": 0.017039507382550306,
                "current": 0.000138,
                "maximum": 1.007649,
                "minimum": 0,
                "standardDeviation": 0.05289178277920594
            }
        },
        "a8266ecf031671f3": {
            "counts": {
                "fail": 0,
                "success": 735
            },
            "latency": {
                "average": 0.012124141496598642,
                "current": 0.000559,
                "maximum": 0.791547,
                "minimum": 0,
                "standardDeviation": 0.04187900156583733
            }
        }
    },
    "leader": "924e2e83e93f2560"
}

0 人点赞