-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[metricbeat][libbeat] template setup fails with number_of_shards=4 #9119
Comments
@Feder1co5oave Thanks for bringing this up. I think the first work around we should do is document this better. As you pointed out it is pretty simple to fix it in the config itself. The intention of hardcoding a value was to give the user by default a potential option to split the shards. Instead of guessing a number_of_routing shards when someone modifies the number_of_shards I would rather suggest that we error out and require the user to change it. |
@ruflin thanks for getting back to me. I agree, had the option been documented, I wouldn't have incurred in this issue. Also, I believe not many people are familiar with the |
Version: 7.0.1 |
The same issue in filebeat 7.5.2. |
Seems like documenting this behavior is needed. @elastic/beats WDYT? |
Added docs and bug label. Elasticsearch 7.0 did improve shard splitting support, making the setting optional. We should remove For reference:
Some users still might want to set the setting, but we should not include it by default in 7.x anymore. From docs side we should include a small section about shard splitting and link to the Elasticsearch docs. |
The setting is going to be removed from the default template via #16038. @dedemorton I don't think we need to adapt the 7.x docs, as the setting is a workaround for Elasticsearch 6.x. |
same issue apm server 7.3.2 |
The fix will be available with the 7.7.0 release. All Beats and apm-server do not set |
metricbeat.yml
:The following mapping is produced by metricbeat: (
metricbeat export template
)When the above template is uploaded to elasticsearch, like this
the following is returned
When running
metricbeat setup --template -e
, the error is lost in the huge output.This bug was introduced in #5570. Choosing a hard-coded default value of 30 just because it fits the largest number of possible
number_of_shards
values sounds like a lazy solution to me. It doesn't fit 4.The offending line is this:
beats/libbeat/template/template.go
Lines 207 to 211 in df74c26
Proposed fix: why not set
number_of_routing_shards
to, say, six times thenumber_of_shards
when it is set in the configuration file, or 30 otherwise?Addendum:
I can't find anything about this
number_of_routing_shards
in the most recent documentation w.r.t. metricbeat configuration: https://www.elastic.co/guide/en/beats/metricbeat/master/configuration-template.htmleven though it seemed clear from the linked PR that the option should have been documented.
Editing the metricbeat configuration like this would have fixed the issue.
The text was updated successfully, but these errors were encountered: