Hi,
I'm useing the rally to test my es-cluster.
I need to set number_of_replicas is 0, but the index still be created with number_of_replicas=1. I
don't understand why, the indices config should be OK.
the indices body file:
{
"settings": {
"index.number_of_shards": {{number_of_shards | default(5)}},
"index.number_of_replicas": {{number_of_replicas | default(0)}},
"index.requests.cache.enable": false
},
"analysis": {
"analyzer": {
"lower_case_keyword_analyzer": {
"type": "custom",
"tokenizer": "keyword",
"filter": "lowercase"
},
"2ngram_analyzer": {
"tokenizer": "2ngram_tokenizer"
}
},
"tokenizer": {
"2ngram_tokenizer": {
"type": "ngram",
"min_gram": 2,
"max_gram": 5,
"token_chars": [
"letter",
"digit"
]
}
}
},
"mappings": {
"articles": {
"_source": {
"enabled": {{ source_enabled | default(true) | tojson }}
},
"dynamic": "strict",
"_all": {
"enabled": false
},
"properties": {
"docid": {
"type": "keyword"
},
"parentpath": {
"type": "keyword"
},
"basename": {
"type": "text",
"analyzer": "hanlp_index"
},
"ext": {
"type": "text",
"analyzer": "lower_case_keyword_analyzer",
"fielddata": true
},
"creator": {
"type": "keyword"
},
"created": {
"type": "long"
},
"editor": {
"type": "keyword"
},
"modified": {
"type": "long"
},
"size": {
"type": "integer"
},
"csflevel": {
"type": "integer"
},
"tags": {
"type": "keyword",
"fields": {
"suggest": {
"type": "completion",
"analyzer": "lower_case_keyword_analyzer"
}
}
},
"objtype": {
"type": "integer"
},
"content": {
"type": "text",
"analyzer": "hanlp_index"
}
}
}
}
}
Hello,
Could you please reformat the track details in your post using the </>
icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted? As it is now it's really difficult to read.
Could you also please share your rally command? At the very least you'll need to use --track-params to specify something like --track-params=number_of_replicas:0
. As an example you could also take a look at: https://github.com/elastic/rally-tracks/tree/master/geopoint#parameters
Dimitris
Hi, Thanks for your suggest.
I find the reason,the indices body setting only effective when using create-index。If I set operation-type:bulk,the setting is not working. So I rebuild my challenge like this:
{
"name": "index-test-challenge",
"default": true,
"description": "新增索引测试",
"schedule": [
{
"operation": {
"operation-type": "create-index",
"index": "test-index",
"settings": {{index_settings | default({}) | tojson}}
}
},
{
"operation": {
"operation-type": "bulk",
"bulk-size": 5000,
"indices": ["test-index"],
"corpora": ["test_docs"]
}
}
]
}
I think it's a issue.
Hello,
I see the source of confusion.
If you use the bulk
operation without a preceding create-index operation, Rally will just create the index (equivalent to PUT /myindex
) specified in your corpora section, and rely on Elasticsearch version defaults: i.e. using dynamic mapping and default index settings.
The track you shared above allows overriding index settings, but doesn't use the index body you mentioned in your first post as you aren't specifying the body or have an indices section in the track.
Configurable settings/mappings (as jinja2 variables) should be specified in the index body.
The relevant doc parts show:
settings
(optional): Allows to specify additional index settings that will be merged with the index settings specified in the body of the index in theindices
section.
body
(optional): File name of the corresponding index definition that will be used as body in the create index API call.
Dimitris
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.