{"id":548,"date":"2024-11-09T16:25:07","date_gmt":"2024-11-09T08:25:07","guid":{"rendered":"http:\/\/www.wengdao.net\/?p=548"},"modified":"2024-11-12T01:06:17","modified_gmt":"2024-11-11T17:06:17","slug":"elasticsearch-%e4%b8%bb%e8%a6%81%e6%8e%a5%e5%8f%a3%e6%98%8e%e7%bb%86","status":"publish","type":"post","link":"https:\/\/jiandao.zliby.com\/?p=548","title":{"rendered":"Elasticsearch \u5b98\u65b9\u63a5\u53e3\u660e\u7ec6"},"content":{"rendered":"<p>[TOC]<\/p>\n<h3>Cat Apis<\/h3>\n<h4>\u96c6\u7fa4\u7684\u7d22\u5f15\u4fe1\u606f indices<\/h4>\n<p>1.cluster health\uff08\u96c6\u7fa4\u5065\u5eb7\uff09API \u53ef\u4ee5\u83b7\u53d6\u4e00\u4e2a\u96c6\u7fa4\u5065\u5eb7\u7684\u7b80\u5355\u72b6\u6001<\/p>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cat\/indices?pretty&#039; <\/code><\/p>\n<table>\n<thead>\n<tr>\n<th>key<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>health<\/td>\n<td>green \u5219\u4ee3\u8868\u5065\u5eb7\u6ca1\u95ee\u9898\uff0c\u5982\u679c\u662f yellow \u6216\u8005 red \u5219\u662f\u96c6\u7fa4\u6709\u95ee\u9898<\/td>\n<\/tr>\n<tr>\n<td>index<\/td>\n<td>\u7d22\u5f15\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td>pri<\/td>\n<td>\u4e3b\u5206\u7247\u6570\u91cf<\/td>\n<\/tr>\n<tr>\n<td>docs.count<\/td>\n<td>\u7d22\u5f15\u6587\u6863\u7684\u603b\u6570<\/td>\n<\/tr>\n<tr>\n<td>docs.deleted<\/td>\n<td>\u7d22\u5f15\u6587\u6863\u7684\u5220\u9664\u603b\u6570<\/td>\n<\/tr>\n<tr>\n<td>store.size<\/td>\n<td>\u4e3b\u5206\u7247\u548c\u526f\u672c\u5206\u7247\u5360\u7528\u7684\u5b58\u50a8\u5927\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>pri.store.size<\/td>\n<td>\u4e3b\u5206\u7247\u5360\u7528\u7684\u5b58\u50a8\u5927\u5c0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"prettyprint\" >health status index                                     uuid                   pri rep docs.count docs.deleted store.size pri.store.size\ngreen  open   .ds-filebeat-8.0.1-2023.02.09-000024      wQ6237ZPS3uhriIP9exr7Q   1   0      50960            0       10mb           10mb\ngreen  open   .ds-metricbeat-8.0.1-2023.02.14-000029    qLoFPguFRnSFOhunT_efSg   1   0     153616            0     76.3mb         76.3mb\ngreen  open   .ds-metricbeat-8.0.1-2023.02.13-000028    uuhrIVjvSA6osh3FhHgRiw   1   0     153512            0     78.9mb         78.9mb\ngreen  open   .ds-filebeat-8.0.1-2023.02.08-000022      M2lrl9tUR0ycVBWqKC8sKA   1   0      49852            0      9.9mb          9.9mb\nyellow open   .ds-.monitoring-es-8-mb-2023.02.09-000002 mhDHO1RoRjeLk31ANoqPVw   1   1     814114            0    366.5mb        366.5mb\ngreen  open   .ds-metricbeat-8.0.1-2023.02.10-000025    Vy0Lp_aiSo-oZX441XwWtw   1   0     153305            0     83.7mb         83.7mb\ngreen  open   .ds-metricbeat-8.0.1-2023.02.12-000027    v7wV2JlcRRC8XF0ai05HzQ   1   0     153495            0     78.4mb         78.4mb\nyellow open   .ds-.monitoring-es-8-mb-2023.02.08-000001 _9Knmmh4SC60gE3InaQeTQ   1   1     731657            0    328.7mb        328.7mb\ngreen  open   .ds-metricbeat-8.0.1-2023.02.11-000026    rrp51F8fTgub6T8d0V7YBg   1   0     153351            0     82.5mb         82.5mb\n<\/code><\/pre>\n<h2><\/h2>\n<h4>\u96c6\u7fa4\u5065\u5eb7\u72b6\u6001 health<\/h4>\n<p>1.cluster health\uff08\u96c6\u7fa4\u5065\u5eb7\uff09API \u53ef\u4ee5\u83b7\u53d6\u4e00\u4e2a\u96c6\u7fa4\u5065\u5eb7\u7684\u7b80\u5355\u72b6\u6001<\/p>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cat\/health?pretty&#039; <\/code><\/p>\n<pre><code class=\"prettyprint\" >{\n    cluster_name: &quot;my-es&quot;,\n    status: &quot;yellow&quot;,  #\u72b6\u6001\u4e3a green \u5219\u4ee3\u8868\u5065\u5eb7\u6ca1\u95ee\u9898\uff0c\u5982\u679c\u662f yellow \u6216\u8005 red \u5219\u662f\u96c6\u7fa4\u6709\u95ee\u9898\n    timed_out: false,#\u662f\u5426\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4\n    number_of_nodes: 1,#\u96c6\u7fa4\u7684\u8282\u70b9\u6570\n    number_of_data_nodes: 1,#\u6570\u636e\u8282\u70b9\u6570\n    active_primary_shards: 5,#\u96c6\u7fa4\u4e2d\u6240\u6709\u6d3b\u8dc3\u7684\u4e3b\u5206\u7247\u6570\n    active_shards: 5,#\u96c6\u7fa4\u4e2d\u5206\u7247\u6570\u91cf\n    relocating_shards: 0,#\u6570\u636e\u8f6c\u79fb\u5206\u7247\u6570\n    initializing_shards: 0,#\u6b63\u5728\u521d\u59cb\u5316\u7684\u5206\u7247\n    unassigned_shards: 5,#\u672a\u5206\u914d\u7684\u5206\u7247\u6570\n    delayed_unassigned_shards: 0,\n    number_of_pending_tasks: 0,\n    number_of_in_flight_fetch: 0,\n    task_max_waiting_in_queue_millis: 0,\n    active_shards_percent_as_number: 50 #\u96c6\u7fa4\u5206\u7247\u7684\u53ef\u7528\u6027\u767e\u5206\u6bd4\uff0c\u5982\u679c\u4e3a0\u5219\u8868\u793a\u4e0d\u53ef\u7528\n}\n<\/code><\/pre>\n<p>2.\u8be5API\u4e5f\u53ef\u4ee5\u9488\u5bf9\u4e00\u4e2a\u6216\u591a\u4e2a\u7d22\u5f15\u6267\u884c\u8bf7\u6c42\u4ee5\u83b7\u5f97\u6307\u5b9a\u7d22\u5f15\u7684\u5065\u5eb7\u72b6\u6001 :<\/p>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cluster\/health\/index?level=shards&amp;pretty&#039; <\/code><\/p>\n<p><\/p>\n<hr \/>\n<h4>\u96c6\u7fa4\u5206\u7247\u7684\u72b6\u6001 shards<\/h4>\n<p>1 shards API \u53ef\u4ee5\u83b7\u53d6\u4e00\u4e2a\u96c6\u7fa4\u5206\u7247\u7684\u72b6\u6001<\/p>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cat\/shards?v&#039;  <\/code><\/p>\n<table>\n<thead>\n<tr>\n<th>key<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>index<\/td>\n<td>\u7d22\u5f15\u7684\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td>shard<\/td>\n<td>\u5206\u7247\u7684\u540d\u79f0id<\/td>\n<\/tr>\n<tr>\n<td>prirep<\/td>\n<td>\u5206\u7247\u7c7b\u578b\u3002\u8fd4\u56de\u503c\u4e3aprimary\u6216replica<\/td>\n<\/tr>\n<tr>\n<td>state<\/td>\n<td>\u5206\u7247\u7684\u72b6\u6001:INITIALIZING\uff1a\u5206\u7247\u6b63\u5728\u4ece\u5bf9\u7b49\u5206\u7247\u6216\u7f51\u5173\u4e2d\u6062\u590d\u3002RELOCATING: \u788e\u7247\u6b63\u5728\u642c\u8fc1\u3002STARTED: \u5206\u7247\u5df2\u7ecf\u5f00\u59cb\u3002UNASSIGNED\uff1a\u5206\u7247\u672a\u5206\u914d\u7ed9\u4efb\u4f55\u8282\u70b9\u3002<\/td>\n<\/tr>\n<tr>\n<td>docs<\/td>\n<td>\u5206\u7247\u4e2d\u7684\u6587\u6863\u6570<\/td>\n<\/tr>\n<tr>\n<td>store<\/td>\n<td>\u5206\u7247\u4f7f\u7528\u7684\u78c1\u76d8\u7a7a\u95f4<\/td>\n<\/tr>\n<tr>\n<td>ip<\/td>\n<td>\u8282\u70b9\u7684 IP<\/td>\n<\/tr>\n<tr>\n<td>node<\/td>\n<td>\u8282\u70b9\u540d\u79f0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"prettyprint\" >index                                                         shard prirep state         docs    store ip          node\n.kibana-event-log-8.0.1-000008                                0     p      STARTED          4   18.7kb 10.42.241.6 ll-es-0\n.ds-.logs-deprecation.elasticsearch-default-2022.09.21-000015 0     p      STARTED          0     225b 10.42.241.6 ll-es-0\n.ds-.logs-deprecation.elasticsearch-default-2022.06.15-000008 0     p      STARTED          0     225b 10.42.241.6 ll-es-0\n.ds-filebeat-8.0.1-2023.02.13-000028                          0     p      STARTED      53683   10.5mb 10.42.241.6 ll-es-0\n.ds-filebeat-8.0.1-2023.02.08-000022                          0     p      STARTED      49852    9.9mb 10.42.241.6 ll-es-0\n<\/code><\/pre>\n<p><\/p>\n<hr \/>\n<h4>\u96c6\u7fa4\u8282\u70b9\u4fe1\u606f nodes<\/h4>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cat\/nodes?v&#039;  <\/code><\/p>\n<table>\n<thead>\n<tr>\n<th>key<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>ip<\/td>\n<td>node\u8282\u70b9\u7684IP<\/td>\n<\/tr>\n<tr>\n<td>heap.percent<\/td>\n<td>\u5806\u5185\u5b58\u5360\u7528\u767e\u5206\u6bd4<\/td>\n<\/tr>\n<tr>\n<td>ram.percent<\/td>\n<td>\u5185\u5b58\u5360\u7528\u767e\u5206\u6bd4<\/td>\n<\/tr>\n<tr>\n<td>cpu<\/td>\n<td>CPU\u5360\u7528\u767e\u5206\u6bd4<\/td>\n<\/tr>\n<tr>\n<td>load_1m<\/td>\n<td>1\u5206\u949f\u7684\u7cfb\u7edf\u8d1f\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>load_5m<\/td>\n<td>5\u5206\u949f\u7684\u7cfb\u7edf\u8d1f\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>load_15m<\/td>\n<td>15\u5206\u949f\u7684\u7cfb\u7edf\u8d1f\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>node.role<\/td>\n<td>node\u8282\u70b9\u7684\u89d2\u8272<\/td>\n<\/tr>\n<tr>\n<td>master<\/td>\n<td>\u662f\u5426\u662fmaster\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>name<\/td>\n<td>\u8282\u70b9\u540d\u79f0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"prettyprint\" >ip        heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name\n10.0.12.9           12          97   1    0.04    0.04     0.05 dilm      *      node-1<\/code><\/pre>\n<p><\/p>\n<hr \/>\n<h4>\u6240\u6709\u4efb\u52a1\u7684\u8fdb\u5ea6 tasks<\/h4>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cat\/tasks?v&#039;  <\/code><\/p>\n<table>\n<thead>\n<tr>\n<th>key<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>action<\/td>\n<td>\u4efb\u52a1\u52a8\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>task_id<\/td>\n<td>\u4efb\u52a1\u552f\u4e00id<\/td>\n<\/tr>\n<tr>\n<td>parent_task_id<\/td>\n<td>\u7236\u7ea7\u4efb\u52a1id<\/td>\n<\/tr>\n<tr>\n<td>type<\/td>\n<td>\u4efb\u52a1\u52a8\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>start_time<\/td>\n<td>\u4efb\u52a1\u5f00\u59cb\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>timestamp<\/td>\n<td>\u5f00\u59cb\u65f6\u95f4\u65f6\u95f4\u6233\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>running_time<\/td>\n<td>\u8fd0\u884c\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>ip<\/td>\n<td>ip<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"prettyprint\" >action                                             task_id                          parent_task_id                   type       start_time    timestamp running_time ip          node\nhealth-node[c]                                     eoKIZAaXQA-8YideyGnFpA:39        cluster:3                        persistent 1671618088600 10:21:28  62.8d        10.42.241.6 ll-es-0\ngeoip-downloader[c]                                eoKIZAaXQA-8YideyGnFpA:42        cluster:4                        persistent 1671618088671 10:21:28  62.8d        10.42.241.6 ll-es-0<\/code><\/pre>\n<p><\/p>\n<hr \/>\n<h4>\u663e\u793a\u6b63\u5728\u7b49\u5f85\u7684\u4efb\u52a1 pending_tasks<\/h4>\n<p>\u6392\u961f\u7684\u4efb\u52a1<\/p>\n<p><code class=\"prettyprint\" >curl -XGET &#039;localhost:9200\/_cat\/pending_tasks?v&#039;  <\/code><\/p>\n<table>\n<thead>\n<tr>\n<th>key<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>insertOrder<\/td>\n<td>\u4efb\u52a1\u63d2\u5165\u987a\u5e8f<\/td>\n<\/tr>\n<tr>\n<td>timeInQueue<\/td>\n<td>\u4efb\u52a1\u6392\u961f\u4e86\u591a\u957f\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>priority<\/td>\n<td>\u4efb\u52a1\u4f18\u5148\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>source<\/td>\n<td>\u4efb\u52a1\u6e90<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u6240\u6709cat\u547d\u4ee4\u5217\u8868<\/h4>\n<table>\n<thead>\n<tr>\n<th>\u63cf\u8ff0<\/th>\n<th>\u5bf9\u5e94\u63a5\u53e3<\/th>\n<th><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u7a7a\u95f4\u5360\u7528\u8d44\u6e90\u5206\u914d<\/td>\n<td>\/_cat\/allocation<\/td>\n<\/tr>\n<tr>\n<td>\u7d22\u5f15\u7684\u5206\u7247\u60c5\u51b5<\/td>\n<td>\/_cat\/shards<\/td>\n<\/tr>\n<tr>\n<td>\u6307\u5b9a\u7d22\u5f15\u7684\u5206\u7247\u660e\u7ec6<\/td>\n<td>\/_cat\/shards\/{index}<\/td>\n<\/tr>\n<tr>\n<td>master\u8282\u70b9\u7684\u4fe1\u606f<\/td>\n<td>\/_cat\/master<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u8282\u70b9\u4fe1\u606f<\/td>\n<td>\/_cat\/nodes<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u96c6\u7fa4\u6240\u6709\u4efb\u52a1<\/td>\n<td>\/_cat\/tasks<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u7684\u7d22\u5f15\u4fe1\u606f\uff0c\u5305\u542b\u5206\u7247\u8ba1\u6570\u3001\u6587\u6863\u6570\u91cf\u3001\u5220\u9664\u6587\u6863\u6570\u3001\u72b6\u6001\u3001\u5b58\u50a8\u7b49<\/td>\n<td>\/_cat\/indices<\/td>\n<\/tr>\n<tr>\n<td>\u6307\u5b9a\u7d22\u5f15\u7684\u5206\u7247\u4fe1\u606f<\/td>\n<td>\/_cat\/indices\/{index}<\/td>\n<\/tr>\n<tr>\n<td>\u7d22\u5f15 Lucene segments \u4fe1\u606f<\/td>\n<td>\/_cat\/segments<\/td>\n<\/tr>\n<tr>\n<td>\u6307\u5b9a\u7d22\u5f15 Lucene segments \u4fe1\u606f<\/td>\n<td>\/_cat\/segments\/{index}<\/td>\n<\/tr>\n<tr>\n<td>\u6240\u6709\u7d22\u5f15\u7684\u6587\u6863\u4e2a\u6570<\/td>\n<td>\/_cat\/count<\/td>\n<\/tr>\n<tr>\n<td>\u6307\u5b9a\u7d22\u5f15\u7d22\u5f15\u7684\u6587\u6863\u4e2a\u6570<\/td>\n<td>\/_cat\/count\/{index}<\/td>\n<\/tr>\n<tr>\n<td>\u7d22\u5f15\u5206\u7247\u7684\u6062\u590d\u89c6\u56fe<\/td>\n<td>\/_cat\/recovery<\/td>\n<\/tr>\n<tr>\n<td>\u6307\u5b9a\u7d22\u5f15\u5206\u7247\u7684\u6062\u590d\u89c6\u56fe<\/td>\n<td>\/_cat\/recovery\/{index}<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u7684\u8fd0\u884c\u72b6\u51b5<\/td>\n<td>\/_cat\/health<\/td>\n<\/tr>\n<tr>\n<td>\u88ab\u6302\u8d77\u7684\u4efb\u52a1<\/td>\n<td>\/_cat\/pending_tasks<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u4e0b\u7684\u6240\u6709\u522b\u540d\u4fe1\u606f<\/td>\n<td>\/_cat\/aliases<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u4e0b\u7684\u6307\u5b9a\u522b\u540d\u4fe1\u606f<\/td>\n<td>\/_cat\/aliases\/{alias}<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u4e2d\u6bcf\u4e2a\u8282\u70b9\u7684\u7ebf\u7a0b\u6c60\u4fe1\u606f<\/td>\n<td>\/_cat\/thread_pool<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u4e2d\u6307\u5b9a\u8282\u70b9\u7684\u7ebf\u7a0b\u6c60\u4fe1\u606f<\/td>\n<td>\/_cat\/thread_pool\/{thread_pools}<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u6bcf\u4e2a\u8282\u70b9\u6b63\u5728\u8fd0\u884c\u7684\u63d2\u4ef6<\/td>\n<td>\/_cat\/plugins<\/td>\n<\/tr>\n<tr>\n<td>\u8282\u70b9\u5b57\u6bb5\u5206\u914d\u60c5\u51b5<\/td>\n<td>\/_cat\/fielddata<\/td>\n<\/tr>\n<tr>\n<td>\u6307\u5b9a\u5b57\u6bb5\u8282\u70b9\u5206\u914d\u60c5\u51b5<\/td>\n<td>\/_cat\/fielddata\/{fields}<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u8282\u70b9\u5c5e\u6027<\/td>\n<td>\/_cat\/nodeattrs<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u7684\u5feb\u7167\u4ed3\u5e93<\/td>\n<td>\/_cat\/repositories<\/td>\n<\/tr>\n<tr>\n<td>ES\u7684\u5feb\u7167\u4ed3\u5e93<\/td>\n<td>\/_cat\/snapshots\/{repository}<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u7fa4\u7684\u7d22\u5f15\u6a21\u677f<\/td>\n<td>\/_cat\/templates<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Cluster Apis \u76f8\u5173\u63a5\u53e3<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u91cd\u8981\u5ea6<\/th>\n<th>API<\/th>\n<th>\u8bf4\u660e<\/th>\n<th>\u8bf7\u6c42 (curl)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u2b50\u2b50\u2b50\u2b50\u2b50<\/strong><\/td>\n<td><strong>Cluster Health API<\/strong><\/td>\n<td>\u68c0\u67e5\u96c6\u7fa4\u7684\u6574\u4f53\u5065\u5eb7\u72b6\u6001\uff0c\u5305\u62ec\u8282\u70b9\u3001\u5206\u7247\u548c\u7d22\u5f15\u7684\u5065\u5eb7\u72b6\u6001\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_cluster\/health?pretty&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50\u2b50\u2b50<\/strong><\/td>\n<td><strong>Cluster Stats API<\/strong><\/td>\n<td>\u83b7\u53d6\u96c6\u7fa4\u7684\u7edf\u8ba1\u6570\u636e\uff0c\u5982\u6587\u6863\u6570\u3001\u5206\u7247\u4fe1\u606f\u3001\u8282\u70b9\u72b6\u6001\u3001\u5185\u5b58\u4f7f\u7528\u7b49\u6027\u80fd\u6307\u6807\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_cluster\/stats?pretty&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50\u2b50\u2b50<\/strong><\/td>\n<td><strong>Cluster State API<\/strong><\/td>\n<td>\u67e5\u770b\u96c6\u7fa4\u7684\u5f53\u524d\u72b6\u6001\u4fe1\u606f\uff0c\u5305\u62ec\u8282\u70b9\u3001\u7d22\u5f15\u5143\u6570\u636e\u3001\u5206\u7247\u5206\u914d\u7b49\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_cluster\/state?pretty&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50\u2b50<\/strong><\/td>\n<td><strong>Nodes Stats API<\/strong><\/td>\n<td>\u83b7\u53d6\u6bcf\u4e2a\u8282\u70b9\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u5982\u5185\u5b58\u4f7f\u7528\u3001CPU \u8d1f\u8f7d\u3001\u78c1\u76d8 I\/O\uff0c\u4fbf\u4e8e\u76d1\u63a7\u6027\u80fd\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_nodes\/stats?pretty&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50\u2b50<\/strong><\/td>\n<td><strong>Nodes Info API<\/strong><\/td>\n<td>\u83b7\u53d6\u6bcf\u4e2a\u8282\u70b9\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u89d2\u8272\u3001JVM \u7248\u672c\u3001\u63d2\u4ef6\u7b49\uff0c\u7528\u4e8e\u67e5\u770b\u96c6\u7fa4\u62d3\u6251\u548c\u8282\u70b9\u914d\u7f6e\u4fe1\u606f\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_nodes?pretty&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50<\/strong><\/td>\n<td><strong>Cluster Settings API<\/strong><\/td>\n<td>\u67e5\u770b\u548c\u66f4\u65b0\u96c6\u7fa4\u7ea7\u522b\u7684\u8bbe\u7f6e\uff0c\u5305\u62ec\u6301\u4e45\u6027\u548c\u77ac\u65f6\u6027\u914d\u7f6e\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_cluster\/settings?pretty&#039;<\/code> <br \/> <code>curl -X PUT &#039;localhost:9200\/_cluster\/settings&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{ &quot;persistent&quot;: { &quot;setting_key&quot;: &quot;value&quot; }}&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50<\/strong><\/td>\n<td><strong>Cluster Reroute API<\/strong><\/td>\n<td>\u624b\u52a8\u63a7\u5236\u5206\u7247\u7684\u5206\u914d\uff0c\u4f8b\u5982\u91cd\u65b0\u5206\u914d\u672a\u5206\u914d\u7684\u5206\u7247\u6216\u5c06\u5206\u7247\u4ece\u4e00\u4e2a\u8282\u70b9\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u8282\u70b9\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X POST &#039;localhost:9200\/_cluster\/reroute&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{ &quot;commands&quot;: [ { &quot;move&quot;: { &quot;index&quot;: &quot;index_name&quot;, &quot;shard&quot;: 0, &quot;from_node&quot;: &quot;node-1&quot;, &quot;to_node&quot;: &quot;node-2&quot; }}]}&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50\u2b50<\/strong><\/td>\n<td><strong>Pending Tasks API<\/strong><\/td>\n<td>\u83b7\u53d6\u5f53\u524d\u7b49\u5f85\u6267\u884c\u7684\u96c6\u7fa4\u4efb\u52a1\u5217\u8868\uff0c\u5e2e\u52a9\u67e5\u770b\u914d\u7f6e\u53d8\u66f4\u548c\u5206\u7247\u8fc1\u79fb\u7684\u5f85\u5904\u7406\u4efb\u52a1\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_cluster\/pending_tasks?pretty&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50<\/strong><\/td>\n<td><strong>Cluster Allocation Explain API<\/strong><\/td>\n<td>\u5206\u6790\u5206\u7247\u5206\u914d\u72b6\u51b5\uff0c\u67e5\u627e\u672a\u5206\u914d\u5206\u7247\u7684\u539f\u56e0\uff0c\u7279\u522b\u5728\u5206\u7247\u5206\u914d\u51fa\u73b0\u95ee\u9898\u65f6\u4f7f\u7528\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X POST &#039;localhost:9200\/_cluster\/allocation\/explain&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{ &quot;index&quot;: &quot;index_name&quot;, &quot;shard&quot;: 0, &quot;primary&quot;: true }&#039;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u2b50<\/strong><\/td>\n<td><strong>Remote Cluster API<\/strong><\/td>\n<td>\u8bbe\u7f6e\u548c\u67e5\u770b\u8fdc\u7a0b\u96c6\u7fa4\u8fde\u63a5\u4fe1\u606f\uff0c\u652f\u6301\u8de8\u96c6\u7fa4\u641c\u7d22\u548c\u6570\u636e\u8bbf\u95ee\u3002<\/td>\n<td><code class=\"prettyprint\" >curl -X GET &#039;localhost:9200\/_remote\/info?pretty&#039;<\/code> <br \/> <code>curl -X PUT &#039;localhost:9200\/_cluster\/settings&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{ &quot;persistent&quot;: { &quot;cluster.remote.remote_cluster.seeds&quot;: [&quot;remote_host:9300&quot;] }}&#039;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/elkguide.elasticsearch.cn\/elasticsearch\/monitor\/api\/cat-cmd.html\">https:\/\/elkguide.elasticsearch.cn\/elasticsearch\/monitor\/api\/cat-cmd.html<\/a><\/p>\n<p>\u5f15\u7528\u8d44\u6599<br \/>\n<a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/7.7\/cat.html\">https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/7.7\/cat.html<\/a><br \/>\n<a href=\"https:\/\/doc.codingdict.com\/elasticsearch\/226\/\">https:\/\/doc.codingdict.com\/elasticsearch\/226\/<\/a><br \/>\n<a href=\"https:\/\/rstyro.github.io\/blog\/2020\/09\/24\/Elasticsearch7-cat-API%E8%AF%A6%E8%A7%A3\/\">https:\/\/rstyro.github.io\/blog\/2020\/09\/24\/Elasticsearch7-cat-API%E8%AF%A6%E8%A7%A3\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[TOC] Cat Apis \u96c6\u7fa4\u7684\u7d22\u5f15\u4fe1\u606f indices 1.cluster health\uff08\u96c6\u7fa4\u5065\u5eb7\uff09AP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts\/548"}],"collection":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=548"}],"version-history":[{"count":6,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}