背景说明

  • 本文对 Elasticsearch 7.13 适用

分片的速度与进度

修改副本数

PUT my_index/_settings
{
  "index": {
    "number_of_replicas": 1
  }
}

分片的速度

PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.node_concurrent_recoveries": "4",
    "indices.recovery.max_bytes_per_sec": "100mb"
  }
}

分片的进度

GET _cat/recovery?v=true&h=i,s,t,ty,st,shost,thost,f,fp,b,bp
i               s t      ty   st    shost       thost       f     fp      b bp 
my-index-000001 0 1252ms peer done 192.168.1.1 192.168.1.2 0 100.0% 0 100.0%

快照的速度与进度

快照的速度

  • indices.recovery.max_bytes_per_sec 仍然有效
  • HDFSS3

    max_snapshot_bytes_per_sec  指定创建快照时的速度,默认为 40mb/s
    max_restore_bytes_per_sec   指定数据恢复速度,默认无限制

    快照恢复的进度

    GET _cat/recovery?v=true&h=i,s,t,ty,st,rep,snap,f,fp,b,bp
    i               s t      ty       st    rep     snap   f  fp   b     bp 
    my-index-000001 0 1978ms snapshot done my-repo snap_1 79 8.0% 12086 9.0%

分片与快照恢复的进度

  • 查看分片未分配原因

    GET _cat/shards?v&h=index,docs,shard,prirep,state,unassigned.reason
  • 查看进度

    # 示例
    GET _cat/recovery?v=true&h=index,shard,time,type,stage,files_percent,bytes_percent
    # 示例(简写)
    GET _cat/recovery?v=true&h=i,s,t,ty,st,fp,bp
本文出自 qbit snap

qbit
268 声望279 粉丝