}
此时观察ES集群状态:curl http://10.0.7.220:9200/_cluster/health?pretty
注意到"active_shards_percent_as_number" : 12.0 该项的值产生变化; [FORBIDDEN/12/index read-only / allow delete (api)] - read only elasticsearch indices
If your elasticsearch is responding with 403 and this message:
{
"type": "cluster_block_exception",
}
Then you probably recovered from a full hard drive. The thing is, elasticsearch is switching to read-only if it cannot index more documents because your hard drive is full. With this it ensures availability for read-only queries. Elasticsearch will not switch back automatically but you can disable it by sending
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'