The number of modified index copies of ES cluster reported an error: index read-only / allow delete
ES cluster modifies the number of index copies. Error: index read-only / allow delete (api)
Reason:
The growth rate of es cluster data is too fast, resulting in disk utilization of individual es node nodes above 80%, close to 90%. Due to insufficient data storage space in the data directory of the new ES node, it fails to receive synchronous data from the master master node. In order to protect the data, the ES cluster automatically sets the index shard index to read-only read-only.
Troubleshooting methods:
1: add nodes to the cluster, simple and rough
2: reduce the number of cluster index replicas
3: others: add disks, delete historical data, etc.
We adopt scenario 2 as a temporary response. After the cluster can write normal data, we will point to the operation of step 1 or 3 to completely solve the problem.
Procedure:
1: execute in Dev Tools, the development tool of Kibana (or initiate a PUT request on the server through the curl tool, the same below)
Modify the number of index copies to 1
PUT 48_hot_v1/_settings {"index": {"number_of_replicas": "1"}} reported an error as follows:
The api interface performs the operation
{"type": "cluster_block_exception", "reason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"} error reason:
If the es disk is full and more documents cannot be indexed, elasticsearch will switch to read-only. It ensures the availability of read-only queries. Elasticsearch does not switch back automatically. You can switch back to normal mode by using the following methods:
Curl-XPUT-H "Content-Type: application/json" http://localhost:9200/_all/_settings-d'{"index.blocks.read_only_allow_delete": null}'
Or, execute it in Dev Tools, the development tool of Kibana
PUT _ settings {"index": {"blocks": {"read_only_allow_delete": "false"} Verification: view the setting information of the specified index GET 48_hot_v1/_settings search content is as follows:}, "blocks": {"read_only_allow_delete": "false"} After the configuration takes effect, the cluster starts to delete index replica data. The datanode node disk space is gradually freed.