elasticsearch API官檔 cat API 各命令詳解

cat API 各命令詳解

cat aliases

[etest@ip-10-248-200-95 ~]$ curl 10.248.200.95:9200/_cat/aliases?v

alias      index               filter routing.index routing.search 
ware_index ware_index_20170508 -      -             -              

也可以查詢指定的別名

[etest@ip-10-248-200-95 ~]$ curl 10.248.200.95:9200/_cat/aliases/ware_index?v
alias      index               filter routing.index routing.search 
ware_index ware_index_20170508 -      -             -              

cat allocation

allocation 可以查看每個數據節點分配了多少分片以及他們使用了多少磁盤空間。

[etest@ip-10-248-200-95 ~]$ curl 10.248.200.95:9200/_cat/allocation?v
shards disk.indices disk.used disk.avail disk.total disk.percent host          ip            node   
    12        9.7gb    18.5gb     79.8gb     98.4gb           18 10.248.200.95 10.248.200.95 95_new 

cat count

查詢所有索引中文檔數量

[etest@ip-10-248-200-95 ~]$ curl 10.248.200.95:9200/_cat/count?v
epoch      timestamp count    
1497605456 09:30:56  22422080 

查詢指定索引中文檔數量

[etest@ip-10-248-200-95 ~]$ curl 10.248.200.95:9200/_cat/count/ware_index?v
epoch      timestamp count   
1497605499 09:31:39  3856275

cat fielddata

fielddata 顯示每一個節點中的字段數據,使用了多少堆內存

[etest@ip-10-248-200-95 ~]$ curl 10.248.200.95:9200/_cat/fielddata?v
id                     host          ip            node   total brandName thirdCmCats properties 
-XYVZvY8RBSgT_UTKnm4YA 10.248.200.95 10.248.200.95 95_new  86mb        0b       5.9kb       86mb 

可以指定任意的字段,例如

[etest@ip-10-248-200-95 ~]$ curl "10.248.200.95:9200/_cat/fielddata?v&fields=text"
id                     host          ip            node   total 
-XYVZvY8RBSgT_UTKnm4YA 10.248.200.95 10.248.200.95 95_new  86mb 

cat health

cat indices

cat master

cat nodeattrs

cat nodes

cat pending tasks 等待的任務

這個命令和/_cluster/pending_tasks提供相同的信息。

[etest@ip-10-248-200-95 ~]$ curl "10.248.200.95:9200/_cat/pending_tasks?v"
insertOrder timeInQueue priority source
       1685       855ms HIGH     update-mapping [foo][t]
       1686       843ms HIGH     update-mapping [foo][t]
       1693       753ms HIGH     refresh-mapping [foo][[t]]
       1688       816ms HIGH     update-mapping [foo][t]
       1689       802ms HIGH     update-mapping [foo][t]
       1690       787ms HIGH     update-mapping [foo][t]
       1691       773ms HIGH     update-mapping [foo][t]

cat pulgins

cat recovery

recovery 用來查看索引分片的恢復。包括正在進行和已經完成的。/_recovery?human可以返回相同的json格式的信息。
當索引分片轉移到集群中另一個不同節點的時候,會發生recovery事件,例如:當快照恢復的時候,副本的變化,節點失去連接,節點啟動。當節點啟動的時候,可能會引起本地存儲恢復,并且這種方式是當節點啟動,加載分片時的通用方式。

cat recovery可能的調用方式如下cat recovery

GET _cat/recovery?v
GET _cat/recovery?v&h=i,s,t,ty,st,shost,thost,f,fp,b,bp
GET _cat/recovery?v&h=i,s,t,ty,st,rep,snap,f,fp,b,bp

cat repositories

repositories 可以顯示集群中的快照的資料庫。

GET /_cat/repositories?v
id    type
repo1   fs
repo2   s3

cat thread pool

cat shards

cat segments

cat snapshots

cat templates

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容