怎么解决刚起来的机器延迟高的问题?

直接检查新节点上所有Region的副本状态,确保数据同步完成后再解除Leader驱逐。

  1. 添加evict-leader-scheduler

    pd-ctl -u http://<pd_ip>:<pd_port> scheduler add evict-leader-scheduler <store_id>```
    
  2. 监控Region同步状态

    • 使用PD API检查新节点上是否有未完成的副本(pending peers)或正在传输的快照:
    curl http://<pd_ip>:<pd_port>/pd/api/v1/store/<store_id>
    

    检查 region_countleader_count,同时观察 pending_peer_count 是否为0。

    • 检查TiKV监控指标 raftstore_pending_peer_countraftstore_snapshot_corrupt 确认无异常。
  3. 动态解除Leader驱逐

    • pending_peer_count 持续为0且region_count接近集群平均值时,移除调度器:
    pd-ctl -u http://<pd_ip>:<pd_port> scheduler remove evict-leader-scheduler-<store_id>
    
2 个赞