We have improved the way roles and proxies work significantly in 2.4-M2:
http://doc.akka.io/docs/akka/2.4-M2/scala/cluster-sharding.html

On Mon, Aug 10, 2015 at 9:41 PM, Yifei <sunyifei1...@gmail.com> wrote:

> Thanks Patrik,
>
> I have the scenario shown below:
>
> There are 3 shard regions, A, B and C, A send messages to B, B forwards
> them to C and C will process them and send back to B
>
> ShardRegion A -> ShardRegion B <-> ShardRegion C
>
> A has proxy of B
> B has proxy of C
> C has proxy of B
>
> This will work if I set their roles to the same value, for example, in
> their configuration files, define
> akka.cluster.roles = ["worker"]
> akka.contrib.sharding.role = ["worker"]
>
> However, I wanted to know how this two attributes really mean in Akka
> configurations. So I did some experiments.
>
> A.conf:
> akka.cluster.roles = ["A"]
> akka.contrib.sharding.role = ["B"]
>
> B.conf:
> akka.cluster.roles = ["B"]
> akka.contrib.sharding.role = ["B"]
>
> C.conf:
> akka.cluster.roles = ["C"]
> akka.contrib.sharding.role = ["C"]
>
>
> Result:
>
> 1. B is able to receive messages from A, but from what I saw in logs, A
> does not have a Coordinator instance of proxy B started.
>
> 2. B and C are isolated, C is not able to get messages from B, can I make
> them communicate with each other by using different roles?
>
> 3. There is no oldest coordinators in B and C, all the coordinators
> started are in youngest state.
>
>
> Do you know why these results happen and if I can tweak the configuration
> file to make it work?
>
> Thanks...
>
>
> On Friday, August 7, 2015 at 1:38:18 PM UTC-4, Patrik Nordwall wrote:
>>
>> You can only specify one role in Akka 2.3.x.
>> In 2.4-M2 you can use different settings for each entity type. E.g. User
>> enities can run on nodes with roleX and ShoppingCart enities can run on
>> nodes with roleY.
>> fre 7 aug 2015 kl. 17:33 skrev Yifei <sunyif...@gmail.com>:
>>
>>> Thanks Patrik,
>>>
>>> Can i define multiple roles in akka.contrib.cluster.sharding.role?
>>>
>>> If I have a dispatcher shard region, which starts multiple different
>>> proxies and dispatches messages to those shardregions via the proxy, how
>>> should I define the akka.contrib.cluster.sharding.role?
>>>
>>> If I understand correctly, it should contain all the roles of the
>>> different proxies, but this attribute only allows a single string because I
>>> got this error "role has type LIST rather than STRING"
>>>
>>>
>>> On Friday, August 7, 2015 at 2:28:47 AM UTC-4, Patrik Nordwall wrote:
>>>
>>>> The purpose of the role is to define that the shards are only supposed
>>>> to run on a subset of the nodes, the ones tagged with the specified role.
>>>> If you start it on a node that does not have this role it will be started
>>>> in proxy only mode.
>>>>
>>>> By the way, we have changed this in 2.4-M2 to make the usage of roles
>>>> and proxy only more obvious.
>>>>
>>> On Thu, Aug 6, 2015 at 5:44 PM, Yifei <sunyif...@gmail.com> wrote:
>>>>
>>> After I set akka.contrib.cluster.sharding.role to the same role in
>>>>> akka.cluster.role, it works.
>>>>>
>>>>> What does akka.contrib.cluster.sharding.role mean?
>>>>>
>>>>>
>>>>> On Thursday, August 6, 2015 at 11:37:28 AM UTC-4, Yifei wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have two seeds nodes up in my cluster. When I tried to start a new
>>>>>> shard region, there is always no oldest state actors, and I don't know
>>>>>> where the coordinator is located
>>>>>>
>>>>>> The log looks like this:
>>>>>>
>>>>>> [INFO] [08/06/2015 11:23:31.684]
>>>>>> [OMSAkkaCluster-akka.actor.default-dispatcher-20] 
>>>>>> [akka.tcp://MyCluster@abc:13598/user/sharding/Test1Coordinator]
>>>>>> ClusterSingletonManager state change [Start -> Younger]
>>>>>>
>>>>>> Is there any properties I must set? For example, the roles property
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> --
>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>> >>>>>>>>>> Check the FAQ:
>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>> >>>>>>>>>> Search the archives:
>>>>> https://groups.google.com/group/akka-user
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Akka User List" group.
>>>>>
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to akka-user+...@googlegroups.com.
>>>>> To post to this group, send email to akka...@googlegroups.com.
>>>>>
>>>>
>>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Patrik Nordwall
>>>> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
>>>> Twitter: @patriknw
>>>>
>>>> --
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ:
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >>>>>>>>>> Search the archives:
>>> https://groups.google.com/group/akka-user
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> /Patrik
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to