简体   繁体   English

如何从Logstash控制Elastic index中的分片数量?

[英]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.

相关问题 如何在弹性搜索中从logstash索引自定义字段? - How to index Custom field from logstash in elastic search? 如何从 Logstash 将数据推送到现有索引(弹性搜索)? - How to push data to an existing index(Elastic Search) from Logstash? 如何在弹性搜索Javascript API中定义主分片和副本分片的数量? - How to define number of primary and replica shards in elastic search Javascript api? 如何从 Elastic 搜索中的所有分片中获取数据 - How data is fetched from all shards in Elastic search ElasticSearch Python客户端在创建索引时如何定义分片数量 - ElasticSearch Python client how to define number of shards when creating index Logstash未在弹性搜索中创建索引 - Logstash is not creating index in elastic search 将数据从原始 Elasticsearch 索引移动到另一个具有更高分片数或增加现有索引中的分片数的索引 - Moving data from oine Elasticsearch index to another with higher number of shards or increasing shard number in existing index ELK logstash 翻转索引没有代表分片 - ELK logstash rollover index doesn't has rep shards 两个服务器进行弹性搜索需要多少个分片? - How many shards for elastic search with two servers? 创建索引的未知键 [number_of_shards] - unknown key [number_of_shards] for create index
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM