TransportError(403, u'cluster_block_exception', u'被阻止: [FORBIDDEN/12/index 只读/允许删除 (api)];')

2023-12-20

当我尝试在 elasticsearch 中存储任何内容时,出现错误:

TransportError(403, u'cluster_block_exception', u'blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];')

我已经在索引中插入了大约 2 亿个文档。但我不知道为什么会发生这个错误。 我试过了:

curl -u elastic:changeme -XPUT 'localhost:9200/_cluster/settings' -H 'Content-Type: application/json' -d '{"persistent":{"cluster.blocks.read_only":false}}'

正如这里提到的:ElasticSearch进入“只读”模式,节点无法更改 https://stackoverflow.com/questions/38735514/elasticsearch-entered-read-only-mode-node-cannot-be-altered

结果是:

{"acknowledged":true,"persistent":{"cluster":{"blocks":{"read_only":"false"}}},"transient":{}}

但一切都没有改变。我应该怎么办?


Try GET yourindex/_settings,这将显示您的索引设置。如果read_only_allow_delete is true,然后尝试:

PUT /<yourindex>/_settings
{
  "index.blocks.read_only_allow_delete": null
}

我的问题已经解决了。

请参阅ES配置指南 https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html了解更多详情。

为此,curl 命令是

curl -X PUT "localhost:9200/twitter/_settings?pretty" -H 'Content-Type: application/json' -d '
{
  "index.blocks.read_only_allow_delete": null
}'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

TransportError(403, u'cluster_block_exception', u'被阻止: [FORBIDDEN/12/index 只读/允许删除 (api)];') 的相关文章

随机推荐