小编典典

Elasticsearch Index最大结果窗口配置异常

elasticsearch

当我将此配置添加到/etc/elasticsearch/elasticsearch.ymlubuntu vm中时;

index.max_result_window: 1000000

在此配置后,当我重新启动Elasticsearch时,给我这个异常;

service elasticsearch status

● elasticsearch.service - Elasticsearch    Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)    Active: failed (Result: exit-code) since Pzt 2017-12-11 11:52:02 +03; 1s ago
     Docs: http://www.elastic.co   Process: 17997 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${L   Process: 17994 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)  Main PID: 17997 (code=exited, status=1/FAILURE)

Ara 11 11:51:55 bilal-VirtualBox systemd[1]: Stopped Elasticsearch. Ara 11 11:51:55 bilal-VirtualBox systemd[1]: Starting Elasticsearch... Ara 11 11:51:55 bilal-VirtualBox systemd[1]: Started Elasticsearch. Ara 11 11:52:02 bilal-VirtualBox systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE Ara 11 11:52:02 bilal-VirtualBox systemd[1]: elasticsearch.service: Unit entered failed state. Ara 11 11:52:02 bilal-VirtualBox systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

阅读 489

收藏
2020-06-22

共1个答案

小编典典

这是中的预期行为elasticsearch 5.x。不允许在节点级别配置上设置索引级别设置。

文档中

index.max_result_window(默认值为10,000)是一种保护措施,搜索请求占用的堆内存和时间与+大小成正比。

如果您查看elasticsearch日志,它将显示以下内容,

在节点级别配置中找到索引级别设置。

由于elasticsearch5.x索引级别设置无法在诸如Elasticsearch.yaml之类的节点配置上进行设置,因此无法在系统属性或命令行参数中进行。要升级所有索引,必须通过/
$ {index} / _ settings更新设置API。除非所有设置都是动态的,否则必须关闭所有索引才能应用将来创建的upgradeIndices应该使用索引模板来设置默认值。

解?

请执行以下命令,以确保所有索引上的所有必需值均已更新:

curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
  "index.max_result_window" : "1000"
}'

要么,

您可以使用索引模板。

2020-06-22