当前位置:网站首页>ES cluster_ block_ exception read_ only_ allow_ Delete question

ES cluster_ block_ exception read_ only_ allow_ Delete question

2022-06-26 07:08:00 Talk to me

At one time ES An error is reported when importing data

{
    "error":{
        "root_cause":[
            {
                "type":"cluster_block_exception",
                "reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
            }
        ],
        "type":"cluster_block_exception",
        "reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
    },
    "status":403
}

reason :

This is because ES Data directory of the new node data Not enough storage space , Result from master The master node failed to receive synchronous data , here ES Clusters to protect data , Will automatically fragment the index index Set to read only read-only「cluster_block_exception」

see mappings You can see :"read_only_allow_delete" : "ture"

{
    "settings" : {
      "index" : {
        "refresh_interval" : "1s",
        "number_of_shards" : "5",
        "blocks" : {
          "read_only_allow_delete" : "ture"
        },
        "provided_name" : "index_name",
        "creation_date" : "1561280427271",
        "analysis" : {
          "analyzer" : {
            "comma" : {
              "pattern" : ",",
              "type" : "pattern"
            }
          }
        },
        "number_of_replicas" : "1",
        "uuid" : "xxxxxxxxxxxxxxx",
        "version" : {
          "created" : "6050399"
        }
      }
    }
  }

resolvent :

  • 1 Disk expansion , It can be modified in the configuration file ES Data storage directory , restart ES
  • 2 Release index read-only settings , On the server through curl Tool launch PUT request

Law 1 :

After capacity expansion ~

Law two :

PUT _settings
{
    "index": {
        "blocks": {
            "read_only_allow_delete": "false"
        }
    }
}

 

原网站

版权声明
本文为[Talk to me]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260702004013.html