Reputation: 686
when I add this config to /etc/elasticsearch/elasticsearch.yml
in ubuntu vm;
index.max_result_window: 1000000
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'.
Upvotes: 2
Views: 2901
Reputation: 18743
This is expected behavior in elasticsearch 5.x
.
You are not allowed to set index level settings on node level configuration.
From the documentation,
The index.max_result_window which defaults to 10,000 is a safeguard, search requests take heap memory and time proportional to from + size.
If you check elasticsearch log, it will show you something like,
Found index level settings on node level configuration.
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.
Solution?
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,
You can use Index Template.
Upvotes: 2