Akka 示例不包括 class 'akka.cluster.sbr.SplitBrainResolverProvider'

Akka example does not include class 'akka.cluster.sbr.SplitBrainResolverProvider'

我按照示例在 https://doc.akka.io/docs/akka/current/typed/cluster-sharding.html

设置集群分片

我从https://developer.lightbend.com/start/?group=akka&project=akka-samples-cluster-sharding-java

下载示例

当我尝试 运行 使用 mvn -pl killrweather exec:java -Dexec.args="2553" 的示例时,我收到一个异常:

[2021-07-10 22:26:04,974] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.cluster.Cluster] [KillrWeather-akka.actor.default-dispatcher-3] [Cluster(akka://KillrWeather)] - Cluster Node [akka://KillrWeather@127.0.0.1:2553] - Starting up, Akka version [2.6.1] ...
[2021-07-10 22:26:05,099] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.cluster.Cluster] [KillrWeather-akka.actor.default-dispatcher-3] [Cluster(akka://KillrWeather)] - Cluster Node [akka://KillrWeather@127.0.0.1:2553] - Registered cluster JMX MBean [akka:type=Cluster]
[2021-07-10 22:26:05,099] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.cluster.Cluster] [KillrWeather-akka.actor.default-dispatcher-3] [Cluster(akka://KillrWeather)] - Cluster Node [akka://KillrWeather@127.0.0.1:2553] - Started up successfully
[2021-07-10 22:26:05,127] [ERROR] [akka://KillrWeather@127.0.0.1:2553] [akka.cluster.Cluster] [KillrWeather-akka.actor.default-dispatcher-5] [Cluster(akka://KillrWeather)] - Cluster Node [akka://KillrWeather@127.0.0.1:2553] - crashed, [akka://KillrWeather/system/cluster/core/daemon: exception during creation] - shutting down...
akka.actor.ActorInitializationException: akka://KillrWeather/system/cluster/core/daemon: exception during creation
    at akka.actor.ActorInitializationException$.apply(Actor.scala:195)
    at akka.actor.ActorCell.create(ActorCell.scala:657)
    at akka.actor.ActorCell.invokeAll(ActorCell.scala:509)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:531)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:294)
    at akka.dispatch.Mailbox.run(Mailbox.scala:229)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:242)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: akka.ConfigurationException: Could not create cluster downing provider [akka.cluster.sbr.SplitBrainResolverProvider] 

如果我从 application.conf

中删除行 downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider"

并重新执行集群似乎正确启动:

[2021-07-10 22:37:22,120] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef] [KillrWeather-akka.actor.default-dispatcher-24] [akka://KillrWeather/deadLetters] - Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://KillrWeather/system/cluster/core/daemon/firstSeedNodeProcess-1#-1591142875] to Actor[akka://KillrWeather/deadLetters] was not delivered. [2] dead letters encountered. If this is not an expected behavior then Actor[akka://KillrWeather/deadLetters] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[2021-07-10 22:37:22,120] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef] [KillrWeather-akka.actor.default-dispatcher-24] [akka://KillrWeather/deadLetters] - Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://KillrWeather/system/cluster/core/daemon/firstSeedNodeProcess-1#-1591142875] to Actor[akka://KillrWeather/deadLetters] was not delivered. [3] dead letters encountered. If this is not an expected behavior then Actor[akka://KillrWeather/deadLetters] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[2021-07-10 22:37:22,121] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef] [KillrWeather-akka.actor.default-dispatcher-24] [akka://KillrWeather/deadLetters] - Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://KillrWeather/system/cluster/core/daemon/firstSeedNodeProcess-1#-1591142875] to Actor[akka://KillrWeather/deadLetters] was not delivered. [4] dead letters encountered. If this is not an expected behavior then Actor[akka://KillrWeather/deadLetters] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[2021-07-10 22:37:22,121] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef] [KillrWeather-akka.actor.default-dispatcher-24] [akka://KillrWeather/deadLetters] - Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://KillrWeather/system/cluster/core/daemon/firstSeedNodeProcess-1#-1591142875] to Actor[akka://KillrWeather/deadLetters] was not delivered. [5] dead letters encountered. If this is not an expected behavior then Actor[akka://KillrWeather/deadLetters] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[2021-07-10 22:37:22,121] [INFO] [akka://KillrWeather@127.0.0.1:2553] [akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef] [KillrWeather-akka.actor.default-dispatcher-24] [akka://KillrWeather/deadLetters] - Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://KillrWeather/system/cluster/core/daemon/firstSeedNodeProcess-1#-1591142875] to Actor[akka://KillrWeather/deadLetters] was not delivered. [6] dead letters encountered. If this is not an expected behavior then Actor[akka://KillrWeather/deadLetters] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

class akka.cluster.sbr.SplitBrainResolverProvider 不应该作为 Akka 示例的一部分包含在内吗?

This issue against the samples 似乎表明在 pom.xml 中将 akka.version 升级到 2.6.15 可以解决此问题。