Java配置13-elasticsearch解除只读

Java配置13-elasticsearch解除只读,第1张

Java配置13-elasticsearch解除只读

目录

1.现状

2.方法


1.现状

测试环境elasticsearch所在服务器,磁盘空间满了。导致elasticsearch的索引进入了只读模式,
按照先前的命令

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

报如下错误

{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_all/_settings]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_all/_settings]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}},"status":401}

这是因为先前处理elasticsearch未经授权漏洞时,开启了xpack认证。

2.方法

执行命令时,需加上请求的用户,然后再输入密码

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

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5704895.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存