[英]How to control number of shards in Elastic index from logstash?
I would like to control how many shards a new index should have in my logstash output file. 我想控制一个新索引在我的logstash输出文件中应该有多少个分片。 Ex:
例如:
10-output.conf: 10-output.conf:
output {
if [type] == "mytype" {
elasticsearch {
hosts => [ "1.1.1.1:9200" ]
index => "logstash-mytype-%{+YYYY.ww}"
workers => 8
flush_size => 1000
? <====== what option to control the number of index shards goes here?
}
}
From what I understand in logstash elastic options this is not possible and new index will default to 5 shards? 据我所知, logstash弹性选项无法实现,新索引将默认为5个分片?
The Logstash-Elasticsearch mix it's designed to work differently than what your expectation is: in Elasticsearch one defines an index template in which the number or shards is a configuration setting. Logstash-Elasticsearch混合设计的工作方式与您的期望不同:在Elasticsearch中,定义了一个索引模板 ,其中数字或分片是配置设置。
And whenever Logstash creates a new index by sending documents to this new index, Elasticsearch uses that index template (by matching the new index name with the configured template) to actually create the index. 每当Logstash通过将文档发送到新索引来创建新索引时,Elasticsearch都会使用该索引模板(通过将新索引名称与配置的模板进行匹配)来实际创建索引。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.