登录报内部错误500 no access to elastic

Posted 品鉴初心

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了登录报内部错误500 no access to elastic相关的知识,希望对你有一定的参考价值。

报错现象

原因分析

Elasticsearch认为磁盘空间不足,因此将其自身置于只读模式时,就会出现上面的问题。默认情况下,Elasticsearch 的决定基于可用磁盘空间的百分比,因此在大磁盘上,即使有许多 GB 的可用空间,也会发生这种情况。默认情况下,磁盘空间阈值为95%,因此如总空间为 1TB 磁盘上,至少需要 50GB 的可用空间,否则 Elasticsearch 会将自身置于只读模式。

说明elasticsearch硬盘阈值空间

解决方法

根据上述说明,这里有两种解决方法。

方法一:释放磁盘空间

释放足够的磁盘空间以便超过 5% 的磁盘可用将解决此问题。但是,一旦有足够的磁盘可用,Elasticsearch 不会自动退出只读模式,必须执行以下操作来解锁索引:

# 无账号密码
$ curl -XPUT -H "Content-Type: application/json" https://[YOUR_ELASTICSEARCH_ENDPOINT]:9200/_all/_settings -d "index.blocks.read_only_allow_delete": null
# 有账号密码
$ curl -XPUT --user elastic:test123  -H "Content-Type: application/json" https://[YOUR_ELASTICSEARCH_ENDPOINT]:9200/_all/_settings -d "index.blocks.read_only_allow_delete": null

方法二:更改磁盘阈值设置

cluster.routing.allocation.disk.watermark.flood_stage设置更改为其他内容。它可以设置为较低的百分比或绝对值。以下是如何从文档更改设置的示例:

PUT _cluster/settings

  "transient": 
    "cluster.routing.allocation.disk.watermark.low": "100gb",
    "cluster.routing.allocation.disk.watermark.high": "50gb",
    "cluster.routing.allocation.disk.watermark.flood_stage": "10gb",
    "cluster.info.update.interval": "1m"
  

同样,在这样做之后,必须使用上面的 curl 命令来解锁索引,但之后它们不应再次进入只读模式。

参考文档

no access to elastic

以上是关于登录报内部错误500 no access to elastic的主要内容,如果未能解决你的问题,请参考以下文章

springboot 新工程报错 Failed to configure a DataSource: 'url' attribute is not specified and no e

OSS 访问图片资源报“No ‘Access-Control-Allow-Origin‘”的错误

最新 mysql登录报错“Access denied for user 'root'@'localhost' (using password: NO”的处理方法

最新 mysql登录报错“Access denied for user 'root'@'localhost' (using password: NO”的处理方法

Wordpress 仪表板登录内部 500 错误

eclipse当中的servlet在web.xml已经配置,但是汇报找不到该类的错误,并且报500错误,即内部服务器内部错误