클러스터 인식 라우터 : 여기akka 클러스터 인식 라우터 및 akka 클러스터 샤딩의 사용 사례가 다릅니 까?
val router = system.actorOf(ClusterRouterPool( RoundRobinPool(0), ClusterRouterPoolSettings( totalInstances = 20, maxInstancesPerNode = 1, allowLocalRoutees = false, useRole = None ) ).props(Props[Worker]), name = "router")
, 우리는
router
에 메시지를 보낼 수는 메시지가 원격 routee 배우의 일련 보내드립니다.클러스터 샤딩 (지속성을 고려하지 않음)
class NewShoppers extends Actor { ClusterSharding(context.system).start( "shardshoppers", Props(new Shopper), ClusterShardingSettings(context.system), Shopper.extractEntityId, Shopper.extractShardId ) def proxy = { ClusterSharding(context.system).shardRegion("shardshoppers") } override def receive: Receive = { case msg => proxy forward msg } }
여기, 우리가
proxy
메시지를 보낼 수있는 메시지가 분산됩니다 행위자 (일명, 단체)의 일련 보내드립니다.
그래서, 내 질문은 : 당신은 그냥 어떤 노드에 몇 가지 작업을 보내고 일부 처리 일이하고 싶을 때 it seems both 2 methods can make the tasks distribute to a lot of actors. What's the design choice of above two? Which situation need which choice?
그럼 일관된 해시 풀 라우터는 어떨까요? 클러스터 샤딩과의 차이점은 무엇입니까? – lagom
토폴로지가 동일하면 작업을 동일한 노드로 보내고, 변경하면 해시가 전체 노드 집합에 있기 때문에 다른 노드로 보내기 시작할 수 있습니다. 어떤 방법 으로든 경로를 알려주지 않으므로이 방법으로 ID로 배우를 지정할 수 없습니다. – johanandren
이 기사 : [Akka.Cluster 응용 프로그램의 상태 배포] (https://petabridge.com/blog/akkacluster-state-distribution/?utm_source=tuicool&utm_medium=referral)와 johanandren의 대답이 내 질문입니다. – lagom