有的时候不知道Elasticsearch的分片和副本数量,一般默认是5分片1副本,但如何亲自核对呢?方法也很简单:

curl "http://127.0.0.1:9200/_settings"

输出示例:

{
"index1": {
"settings": {
"index": {
"refresh_interval": "1s",
"number_of_shards": "5",
"provided_name": "index1",
"creation_date": "1604347202709",
"number_of_replicas": "1",
"uuid": "FMECXR9cQGGvs7ZlYiVhsQ",
"version": {
"created": "5030099"
}
}
}
}
}

其中number_of_shards和number_of_replicas就是对应分片和副本数量。

参考资料:Get index settings API



Related Posts: Elasticsearch如何查看当前分片和副本数量配置 :

留言