Elasticsearchのcat recovery

Elasticsearchのcat recoveryについて記す。

公式ドキュメント cat recovery を参考にした。
www.elastic.co

検証環境: Elasticsearch 6.0.0-rc1

cat recoveryは進行中および完了済みのindex shard recoveriesの情報を示す。これは JSON recovery API よりコンパクトに表示される。

リカバリイベントは、インデックスシャードがクラスタ内の別のノードに移動するたびに発生する。これは、スナップショットのリカバリレプリケーションレベルの変更、ノードの障害またはノードの起動時に発生する可能性がある。

bash-3.2$ curl -XGET 'localhost:9200/_cat/recovery?v&pretty'
index         shard time  type           stage source_host source_node target_host target_node repository snapshot files files_recovered files_percent files_total bytes bytes_recovered bytes_percent bytes_total translog_ops translog_ops_recovered translog_ops_percent
bank          0     30ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        98884       0            0                      100.0%
bank          1     36ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        95923       0            0                      100.0%
bank          2     55ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        104775      0            0                      100.0%
bank          3     40ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        100022      0            0                      100.0%
bank          4     48ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        100477      0            0                      100.0%
noindextest   0     220ms existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
noindextest   1     233ms existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
noindextest   2     28ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
noindextest   3     272ms existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        3782        0            0                      100.0%
noindextest   4     285ms existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
indexusertest 0     38ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
indexusertest 1     32ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
indexusertest 2     22ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
indexusertest 3     63ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        3782        0            0                      100.0%
indexusertest 4     38ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
customer      0     29ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
customer      1     22ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
customer      2     43ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        3835        0            0                      100.0%
customer      3     45ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        4           0     0               100.0%        3891        0            0                      100.0%
customer      4     30ms  existing_store done  n/a         n/a         127.0.0.1   Xj840__     n/a        n/a      0     0               100.0%        1           0     0               100.0%        264         0            0                      100.0%
bash-3.2$ curl -XGET 'localhost:9200/_cat/recovery?help&pretty'
index                  | i,idx | index name                       
shard                  | s,sh  | shard name                       
time                   | t,ti  | recovery time                    
type                   | ty    | recovery type                    
stage                  | st    | recovery stage                   
source_host            | shost | source host                      
source_node            | snode | source node name                 
target_host            | thost | target host                      
target_node            | tnode | target node name                 
repository             | rep   | repository                       
snapshot               | snap  | snapshot                         
files                  | f     | number of files to recover       
files_recovered        | fr    | files recovered                  
files_percent          | fp    | percent of files recovered       
files_total            | tf    | total number of files            
bytes                  | b     | number of bytes to recover       
bytes_recovered        | br    | bytes recovered                  
bytes_percent          | bp    | percent of bytes recovered       
bytes_total            | tb    | total number of bytes            
translog_ops           | to    | number of translog ops to recover
translog_ops_recovered | tor   | translog ops recovered           
translog_ops_percent   | top   | percent of translog ops recovered
bash-3.2$ curl -XGET 'localhost:9200/_cat/recovery?v&h=i,s,t,ty,st,shost,thost,f,fp,b,bp&pretty'
i             s t     ty             st   shost thost     f fp     b bp
bank          0 30ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
bank          1 36ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
bank          2 55ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
bank          3 40ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
bank          4 48ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
noindextest   0 220ms existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
noindextest   1 233ms existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
noindextest   2 28ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
noindextest   3 272ms existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
noindextest   4 285ms existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
indexusertest 0 38ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
indexusertest 1 32ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
indexusertest 2 22ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
indexusertest 3 63ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
indexusertest 4 38ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
customer      0 29ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
customer      1 22ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
customer      2 43ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
customer      3 45ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
customer      4 30ms  existing_store done n/a   127.0.0.1 0 100.0% 0 100.0%
bash-3.2$ curl -XGET 'localhost:9200/_cat/recovery?v&h=i,s,t,ty,st,rep,snap,f,fp,b,bp&pretty'
i             s t     ty             st   rep snap f fp     b bp
bank          0 30ms  existing_store done n/a n/a  0 100.0% 0 100.0%
bank          1 36ms  existing_store done n/a n/a  0 100.0% 0 100.0%
bank          2 55ms  existing_store done n/a n/a  0 100.0% 0 100.0%
bank          3 40ms  existing_store done n/a n/a  0 100.0% 0 100.0%
bank          4 48ms  existing_store done n/a n/a  0 100.0% 0 100.0%
noindextest   0 220ms existing_store done n/a n/a  0 100.0% 0 100.0%
noindextest   1 233ms existing_store done n/a n/a  0 100.0% 0 100.0%
noindextest   2 28ms  existing_store done n/a n/a  0 100.0% 0 100.0%
noindextest   3 272ms existing_store done n/a n/a  0 100.0% 0 100.0%
noindextest   4 285ms existing_store done n/a n/a  0 100.0% 0 100.0%
indexusertest 0 38ms  existing_store done n/a n/a  0 100.0% 0 100.0%
indexusertest 1 32ms  existing_store done n/a n/a  0 100.0% 0 100.0%
indexusertest 2 22ms  existing_store done n/a n/a  0 100.0% 0 100.0%
indexusertest 3 63ms  existing_store done n/a n/a  0 100.0% 0 100.0%
indexusertest 4 38ms  existing_store done n/a n/a  0 100.0% 0 100.0%
customer      0 29ms  existing_store done n/a n/a  0 100.0% 0 100.0%
customer      1 22ms  existing_store done n/a n/a  0 100.0% 0 100.0%
customer      2 43ms  existing_store done n/a n/a  0 100.0% 0 100.0%
customer      3 45ms  existing_store done n/a n/a  0 100.0% 0 100.0%
customer      4 30ms  existing_store done n/a n/a  0 100.0% 0 100.0%