Elasticsearch的一些api随记:修订间差异

来自三线的随记
无编辑摘要
无编辑摘要
第1行: 第1行:
===health===
===Health===
  /_cat/health
  /_cat/health


  /_cluster/health
  /_cluster/health
index health
 
=== Indices health ===
  /_cat/indices?health=red&v&s=store.size:desc,index
  /_cat/indices?health=red&v&s=store.size:desc,index


第10行: 第11行:
  /_cat/indices?health=green&v&s=store.size:desc,index
  /_cat/indices?health=green&v&s=store.size:desc,index


===nodes===
===Nodes===
  /_cat/nodes?v
  /_cat/nodes?v


===cluster allocation explain related===
===Cluster allocation explain related===
  /_cat/shards/index_name-*?v&s=state,index&h=index,shard,prirep,state,docs,store,ip,node,unassigned.reason
  /_cat/shards/index_name-*?v&s=state,index&h=index,shard,prirep,state,docs,store,ip,node,unassigned.reason


  /_cluster/allocation/explain
  /_cluster/allocation/explain


===shards===
===Shards===
  /_cat/shards
  /_cat/shards


  /_cat/shards?index=index_name
  /_cat/shards?index=index_name


===Thread pool related===
===Thread pool related===
第30行: 第32行:
  curl "127.1:9200/_cat/thread_pool?v&h=ip,node_name,id,name,max,size,queue_size,queue,active,rejected&pretty"
  curl "127.1:9200/_cat/thread_pool?v&h=ip,node_name,id,name,max,size,queue_size,queue,active,rejected&pretty"


===cluster settings===
 
===Cluster settings===
  /_cluster/settings?include_defaults=true&pretty
  /_cluster/settings?include_defaults=true&pretty


  /_cluster/settings?include_defaults=true
  /_cluster/settings?include_defaults=true
<br />
====primaries recovery settings====
 
==== primaries recovery settings ====
  {
  {
     "transient": {
     "transient": {
第52行: 第53行:
  }
  }


;
;- new version shard allocation config
;- new version shard allocation config
:cluster.routing.allocation.node_concurrent_recoveries
:cluster.routing.allocation.node_concurrent_recoveries
第69行: 第69行:
     }
     }
  }
  }
     [[分类:Elasticsearch]]
      
<br />
 
=== Index settings ===
 
==== modify the number of replicasin bulk ====
{
  "index" : {
    "number_of_replicas" : 1
  }
}
[[分类:Elasticsearch]]
{{DEFAULTSORT:api随记}}
{{DEFAULTSORT:api随记}}

2021年4月15日 (四) 01:17的版本

Health

/_cat/health
/_cluster/health

Indices health

/_cat/indices?health=red&v&s=store.size:desc,index
/_cat/indices?health=yellow&v&s=store.size:desc,index
/_cat/indices?health=green&v&s=store.size:desc,index

Nodes

/_cat/nodes?v

Cluster allocation explain related

/_cat/shards/index_name-*?v&s=state,index&h=index,shard,prirep,state,docs,store,ip,node,unassigned.reason
/_cluster/allocation/explain

Shards

/_cat/shards
/_cat/shards?index=index_name


Thread pool related

https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html

/_cluster/settings?pretty&include_defaults=true | grep processors

get maximum number of threads info

curl "127.1:9200/_cat/thread_pool?v&h=ip,node_name,id,name,max,size,queue_size,queue,active,rejected&pretty"


Cluster settings

/_cluster/settings?include_defaults=true&pretty
/_cluster/settings?include_defaults=true

primaries recovery settings

{
    "transient": {
        "cluster": {
            "routing": {
                "allocation": {
                    "node_initial_primaries_recoveries": 10,
                    "node_concurrent_incoming_recoveries": null,
                    "node_concurrent_outgoing_recoveries": null,
                    "node_concurrent_recoveries": 20
                }
            }
        }
    }
}
- new version shard allocation config
cluster.routing.allocation.node_concurrent_recoveries
# es 6.8.2
# PUT /_cluster/settings
{
    "persistent": {
        "cluster": {
            "routing": {
                "allocation": {
                    "node_initial_primaries_recoveries": 8
                }
            }
        }
    }
}
   


Index settings

modify the number of replicasin bulk

{
  "index" : {
    "number_of_replicas" : 1
  }
}