elasticsearch index read-only

搜索引擎报下面错误时, 经过排查是因为存储空间不足了.


ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
]
	at org.elasticsearch.cluster.block.ClusterBlocks.indicesBlockedException(ClusterBlocks.java:204)
	at org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction.checkBlock(TransportPutMappingAction.java:75)
	at org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction.checkBlock(TransportPutMappingAction.java:44)

修改配置文件指定索引目录, 找个存储空间充足的盘
config/elasticsearch.yml

path.data: F:/es_data
#
# Path to log files:
#
path.logs: F:/es_data/logs

然后执行解锁操作

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

你可能感兴趣的:(elasticsearch)