# Register coordinator fail when I use proxy-only-mode for cluster sharding

**URL:** <https://discuss.akka.io/t/register-coordinator-fail-when-i-use-proxy-only-mode-for-cluster-sharding/5634>\
**Category:** Akka Cluster\
**Created:** [December 19, 2019, 9:19am UTC](https://discuss.akka.io/t/register-coordinator-fail-when-i-use-proxy-only-mode-for-cluster-sharding/5634 "2019-12-19T09:19:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![i.na](https://avatars.discourse-cdn.com/v4/letter/i/b3f665/32.png) [@i.na](https://discuss.akka.io/u/i.na)\
**Post date:** [December 19, 2019, 9:19am UTC](https://discuss.akka.io/t/register-coordinator-fail-when-i-use-proxy-only-mode-for-cluster-sharding/5634/1 "2019-12-19T09:19:30Z")

</div>

Hello, I’m trying to use cluster sharding with proxy only mode.  
I would like to run 2 node. One is only proxy mode without any entity and another for only entity.

I added below config

```auto
// for proxy only mode
akka.cluster {
    roles = ["frontend", "backend"]
    sharding = {
        role = "frontend"
    }
}
// for entity
akka.cluster {
    roles = ["frontend", "backend"]
    sharding = {
        role = "backend"
    }
}

```

I used ClusterSharding.get(actorSystem).startProxy in ‘frontend’ node,  
and ClusterSharding.get(actorSystem).start in ‘backend’ node.

When ‘frontend’ node tell message to ‘backend’, below log is printed infinitely.

```auto
level=WARN , logger=akka.cluster.sharding.ShardRegion, message=MyActor: Trying to register to coordinator at [ActorSelection[Anchor(akka://myapp@ip:port/), Path(/system/sharding/MyActorCoordinator/singleton/coordinator)]], but no acknowledgement. Total [1] buffered messages. [Coordinator [Member(address = akka://myapp@ip:port, status = Up)] is reachable.]

```

Do I need to add more config for using proxy only mode? Is there any detail reference about it?

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [December 20, 2019, 7:37am UTC](https://discuss.akka.io/t/register-coordinator-fail-when-i-use-proxy-only-mode-for-cluster-sharding/5634/2 "2019-12-20T07:37:12Z")

</div>

`akka.cluster.roles` determines what roles the node has, so from your shared config, both of the nodes have roles `frontend` and `backend`.

The role you configure sharding with says what nodes should host actual shard regions, the other nodes will only be expected to run proxies. For the same shard type, it needs to be the same across all nodes of the cluster or they will have different expectations of what nodes host shard regions and sharding will not work.

When you start sharding, will look at the role and hand you a proxy or a region (`ClusterSharding.init` for typed or `ClusterSharding.start` for classic).

---

<div class="post-metadata">

**Author:** ![i.na](https://avatars.discourse-cdn.com/v4/letter/i/b3f665/32.png) [@i.na](https://discuss.akka.io/u/i.na)\
**Post date:** [December 23, 2019, 2:00am UTC](https://discuss.akka.io/t/register-coordinator-fail-when-i-use-proxy-only-mode-for-cluster-sharding/5634/3 "2019-12-23T02:00:38Z")

</div>

Thank you so much. I modified config and it works for me.

Here is what I modified.  
I hope this will be helpful for others who faced same issue.

Config for entity holder node

```auto
akka.cluster {
    roles = ["MyActor"]
    sharding {
        role = "MyActor"
    }

```

Config for proxy node

```auto
akka.cluster {
    roles = ["MyProxy"]
    sharding {
        role = "MyActor"
    }

```
