本文介绍了Elasticsearch Index最大结果窗口配置异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

when I add this config to /etc/elasticsearch/elasticsearch.yml in ubuntu vm;

index.max_result_window: 1000000

在此配置后重新启动Elasticsearch时给出我是这个例外;

after this config when I restart Elasticsearch give me this exception;

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'.


推荐答案

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

This is expected behavior in elasticsearch 5.x. You are not allowed to set index level settings on node level configuration.

从,

如果您查看elasticsearch日志,它将显示类似的内容

If you check elasticsearch log, it will show you something like,

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

Since elasticsearch 5.x index level settings can NOT be set on the nodes configuration like the elasticsearch.yaml, in system properties or command line arguments.In order to upgrade all indices the settings must be updated via the /${index}/_settings API. Unless all settings are dynamic all indices must be closed in order to apply the upgradeIndices created in the future should use index templates to set default values.

解决方案?

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

Please ensure all required values are updated on all indices by executing:

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

OR,

您可以使用

这篇关于Elasticsearch Index最大结果窗口配置异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 01:44