2

根据http://www.elasticsearch.org/guide/reference/index-modules/merge/ 我可以控制合并策略和合并策略的参数。

我不清楚如何做到这一点。创建索引时,如果我想限制段的大小,我可以这样做:

curl -XPUT 'http://ec2-23-22-207-150.compute-1.amazonaws.com:9200/my_index/' -d '{
    "settings" : {"index":{
        "number_of_shards" : 10,
        "number_of_replicas" : 2,
    "merge":{"policy":{"max_merged_segmentss" : "2gb"}}}
    }
}'

这似乎有效。这样:

curl -XGET 'http://localhost:9200/my_index/_settings?pretty=true'

产量:

{
  "my_index" : {
    "settings" : {
      "index.number_of_replicas" : "2",
      "index.number_of_shards" : "10",
      "index.merge.policy.max_merged_segment" : "2gb",
      "index.version.created" : "900199"
    }
  }
}

但是,如果我改为max_merged_segment使用一些随机标志进行更改,some_random它只会产生:

{
  "my_index" : {
    "settings" : {
      "index.number_of_replicas" : "2",
      "index.number_of_shards" : "10",
      "index.merge.policy.some_random" : "2gb",
      "index.version.created" : "900199"
    }
  }
}

这让我怀疑我做错了什么。

另外,我将如何更改实际的合并策略,例如 from tieredto log_byte_size?我可以在运行时执行此操作,还是仅在创建索引时执行此操作?

4

1 回答 1

0

从 Elasticsearch 2.0 开始,这些设置都不再可配置(尽管这肯定不是您当时遇到的问题,因为那是 2.0 之前的问题)* https://www.elastic.co/guide/en/elasticsearch/参考/2.0/break_20_setting_changes.html#_merge_and_merge_throttling_settings * https://discuss.elastic.co/t/tiered-merge-policy-settings-not-documented-in-2-x-gone/61470/2

于 2016-09-26T06:01:46.073 回答