# ClusterBlockException: 索引[my_index]被阻塞：[FORBIDDEN/12/index read-only / allow delete (api)]；节点[node-1]磁盘使用率超过阈值[95%]

- **ID:** `elasticsearch/index-blocked-by-disk-threshold`
- **领域:** elasticsearch
- **类别:** resource_error
- **错误码:** `DISK_WATERMARK_BLOCK`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

节点上的磁盘使用率超过了高水位线（默认95%），导致Elasticsearch阻止写入操作以防止数据丢失。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Elasticsearch 7.10 | active | — | — |
| Elasticsearch 8.0 | active | — | — |
| Elasticsearch 8.9 | active | — | — |

## 解决方案

1. ```
   通过删除旧索引或移动数据释放磁盘空间：`POST _reindex {"source": {"index": "old_index"}, "dest": {"index": "new_index"}}` 然后删除旧索引
   ```
2. ```
   通过添加新节点或扩展存储增加磁盘容量，然后重新平衡分片：`PUT _cluster/settings {"transient": {"cluster.routing.rebalance.enable": "all"}}`
   ```
3. ```
   临时禁用磁盘分配决策器以允许写入：`PUT _cluster/settings {"transient": {"cluster.routing.allocation.disk.threshold_enabled": false}}`（谨慎使用）
   ```

## 无效尝试

- **Manually removing the index block with `PUT my_index/_settings {"index.blocks.read_only_allow_delete": null}` without freeing disk space** — The block will be reapplied by the cluster when the next disk check runs, as disk usage remains high. (90% 失败率)
- **Increasing the disk watermark thresholds in elasticsearch.yml (e.g., `cluster.routing.allocation.disk.watermark.high: 98%`)** — This only delays the problem and risks data loss if disk fills completely. (70% 失败率)
- **Deleting the index entirely to free space** — This is a destructive action that may cause data loss; it should only be a last resort. (50% 失败率)
