Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
582 views
in Technique[技术] by (71.8m points)

elasticsearch - How many shards per node?

How can I get information how many shards exists per node with specific id? I trying to find this information on the official documentation. But can't. One of the possible scenario it is get information about shards by this request and grouping by nodes:

GET /_cat/shards&v=true

index                      shard prirep state       docs store ip         node
people                     0     p      STARTED        1 4.4kb 172.17.0.2  1
blog                       0     p      STARTED        1 4.8kb 172.17.0.2  2
micrometer-metrics-2021-05 0     p      STARTED    14368   1mb 172.17.0.2  3

If you have any idea or thought please share with me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to use the _cat/allocation API

GET /_cat/allocation/1?v

And you'll get the number of shards for the specified node:

shards disk.indices disk.used disk.avail disk.total disk.percent host       ip         node
   121        1.3tb     1.3tb    466.4gb      1.8tb           74 10.x.y.z   10.x.y.z   1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...