【ElasticSearch】异常错误

================================================================

1、磁盘满了造成 Elasticsearch 成为只读

2、index.highlight.max_analyzed_offset

3、CentOS8 docker 换成了 podman

4、达到最大分分片书 this cluster currently has [1000]/[1000] maximum shards open 此群集当前最多打开[1000]/[1000]个碎片

================================================================

1、磁盘满了造成 Elasticsearch 成为只读

把磁盘重新扩容后还抱下面的错

blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

把多有的索引设置为非只读 https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html

curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

 

2、index.highlight.max_analyzed_offset

PUT assembly-service-2021.02.03/_settings
{
    "index" : {
        "highlight.max_analyzed_offset" : 6000000
    }
}

 

4、达到最大分分片书 this cluster currently has [1000]/[1000] maximum shards open 此群集当前最多打开[1000]/[1000]个碎片

错误

{
    "error": {
        "root_cause": [{
            "type": "validation_exception",
            "reason": "Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [1000]/[1000] maximum shards open;"
        }],
        "type": "validation_exception",
        "reason": "Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [1000]/[1000] maximum shards open;"
    },
    "status": 400
}

 

更新最大分片数

修改有三种方式

kibana

PUT /_cluster/settings
{
  "persistent": {
    "cluster": {
      "max_shards_per_node":10000
    }
  }
}

 

终端

curl -XPUT http://localhost:9200/_cluster/settings -H 'Content-Type:application/json' -d '
{
  "persistent": {
    "cluster": {
      "max_shards_per_node":10000
    }
  }
}'

 

修改配置文件

# vim elasticsearch.yml
cluster.max_shards_per_node: 10000

 

相关文章: