mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
add missing units to index settings if index was created before 2.0
This commit is contained in:
parent
6723c72716
commit
68d6427944
14 changed files with 173 additions and 28 deletions
|
@ -240,7 +240,11 @@ def generate_index(client, version, index_name):
|
|||
client.indices.create(index=index_name, body={
|
||||
'settings': {
|
||||
'number_of_shards': 1,
|
||||
'number_of_replicas': 0
|
||||
'number_of_replicas': 0,
|
||||
# Same as ES default (60 seconds), but missing the units to make sure they are inserted on upgrade:
|
||||
"gc_deletes": '60000',
|
||||
# Same as ES default (5 GB), but missing the units to make sure they are inserted on upgrade:
|
||||
"merge.policy.max_merged_segment": '5368709120'
|
||||
},
|
||||
'mappings': mappings
|
||||
})
|
||||
|
@ -261,7 +265,11 @@ def snapshot_index(client, version, repo_dir):
|
|||
# Add bogus persistent settings to make sure they can be restored
|
||||
client.cluster.put_settings(body={
|
||||
'persistent': {
|
||||
'cluster.routing.allocation.exclude.version_attr': version
|
||||
'cluster.routing.allocation.exclude.version_attr': version,
|
||||
# Same as ES default (30 seconds), but missing the units to make sure they are inserted on upgrade:
|
||||
'discovery.zen.publish_timeout': '30000',
|
||||
# Same as ES default (512 KB), but missing the units to make sure they are inserted on upgrade:
|
||||
'indices.recovery.file_chunk_size': '524288',
|
||||
}
|
||||
})
|
||||
client.indices.put_template(name='template_' + version.lower(), order=0, body={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue