问题描述
1.添加数据时,报错,原因是,一旦在存储超过95%的磁盘中的节点上分配了一个或多个分片的任何索引, 该索引将被强制进入只读模式
ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];] at org.elasticsearch.cluster.block.ClusterBlocks.indexBlockedException(ClusterBlocks.java:183) at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.handleBlockExceptions(TransportReplicationAction.java:806) at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.doRun(TransportReplicationAction.java:706) at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) at org.elasticsearch.action.support.replication.TransportReplicationAction.doExecute(TransportReplicationAction.java:170) at org.elasticsearch.action.support.replication.TransportReplicationAction.doExecute(TransportReplicationAction.java:98) at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:167) at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:128复制代码
2.解决方法
PUT _settings{ "index": { "blocks": { "read_only_allow_delete": "false" } }}复制代码