# Cluster sharding state across all the nodes

**URL:** <https://discuss.akka.io/t/cluster-sharding-state-across-all-the-nodes/6365>\
**Category:** Akka Cluster\
**Tags:** akka-cluster\
**Created:** [April 24, 2020, 9:04pm UTC](https://discuss.akka.io/t/cluster-sharding-state-across-all-the-nodes/6365 "2020-04-24T21:04:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jyeturi](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jyeturi](https://discuss.akka.io/u/jyeturi)\
**Post date:** [April 24, 2020, 9:04pm UTC](https://discuss.akka.io/t/cluster-sharding-state-across-all-the-nodes/6365/1 "2020-04-24T21:04:03Z")

</div>

Using Akka cluster sharding 2.6.3 typed version. Is there any way to retrieve current state and info on nodes, shards and entities in each node?

I tried Akka http managment, it gives nodes and shards info, but it doesn’t provide the entity ids in each shard.

Came across following, which suggests to send `ShardRegion.getShardRegionStateInstance` to the shard region. I do not see how I can send this request for a typed shard region actor. Any sample code in Java would be helpful.  
[https://doc.akka.io/docs/akka/2.6.3/cluster-sharding.html#inspecting-cluster-sharding-state](https://doc.akka.io/docs/akka/2.6.3/cluster-sharding.html#inspecting-cluster-sharding-state)

Is there any way we can retrieve this info across all the nodes, probably from store coordinator?

This would be helpful to monitor and test the cluster.

Thanks

---

<div class="post-metadata">

**Author:** ![patriknw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/patriknw/32/89_2.png) [@patriknw](https://discuss.akka.io/u/patriknw)\
**Post date:** [April 25, 2020, 7:25am UTC](https://discuss.akka.io/t/cluster-sharding-state-across-all-the-nodes/6365/2 "2020-04-25T07:25:22Z")

</div>

The sharding queries are not fully implemented in the new APIs yet. Some are, implemented, some are in progress (PR).

---

<div class="post-metadata">

**Author:** ![jyeturi](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jyeturi](https://discuss.akka.io/u/jyeturi)\
**Post date:** [April 25, 2020, 10:42pm UTC](https://discuss.akka.io/t/cluster-sharding-state-across-all-the-nodes/6365/3 "2020-04-25T22:42:52Z")

</div>

Thanks Patrik for the response. Can you let me know which older version has such support to query shar and entity ids and how would we do it?

---

<div class="post-metadata">

**Author:** ![patriknw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/patriknw/32/89_2.png) [@patriknw](https://discuss.akka.io/u/patriknw)\
**Post date:** [April 26, 2020, 6:12am UTC](https://discuss.akka.io/t/cluster-sharding-state-across-all-the-nodes/6365/4 "2020-04-26T06:12:09Z")

</div>

Currently included in Akka 2.6.4 is `akka.cluster.sharding.typed.GetShardRegionState`.  
Send `GetShardRegionState` message to the `ClusterSharding(system).shardState`. That will get the local regions state.

What is missing is the aggregated queries. Some work in progress in [https://github.com/akka/akka/pull/28666](https://github.com/akka/akka/pull/28666)

As a workaround you should be able to use the queries with the classic ClusterSharding even though the actual entities are initialized with Typed ClusterSharding. Then it’s the messages described in [https://doc.akka.io/docs/akka/current/cluster-sharding.html#inspecting-cluster-sharding-state](https://doc.akka.io/docs/akka/current/cluster-sharding.html#inspecting-cluster-sharding-state). Sending to the ActorRef retrieved with `akka.cluster.sharding.ClusterSharding(system).shardRegion(typeName)`.
