Site icon 时鹏亮的Blog

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

请知悉:本文最近一次更新为 4年 前,文中内容可能已经过时。

有的时候不知道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


如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《Elasticsearch如何查看当前分片和副本数量配置》相关的博文:

Exit mobile version