Hello,World

elasticsearch5.X版本集群主分片未分配如何处置?

Elasticsearch | 作者 cao | 发布于2018年09月12日 | 阅读数:2114

如何强制分配主分片?
目前集群采用5个主分片,1个副本。
已邀请:

easesstone

赞同来自:

在建立索引的时候,指定主分片的个数,主分片指定后不可以修改。但是副本数可以修改,大致如下。
curl -XPUT "master:9200/zebra_info?pretty" -H 'Content-Type: application/json' -d'
{
"settings": {
"number_of_shards":5,
"number_of_replicas":1
},
"mappings": {
"zebra_info": {
"properties": {
"name" : {"type": "text", "analyzer": "ik_max_word", "search_analyzer": "ik_max_word", "fielddata": true, "fields": {"raw": {"type":"keyword"}}},
"firstly_classification": {"type": "keyword"},
"secondary_classification": {"type": "keyword"}
}
}
}
}
}

yayg2008

赞同来自:

你做了什么操作?一般情况下,主分片会自动分配的。

要回复问题请先登录注册