问题标签 [akka.net-cluster]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
501 浏览

akka.net - 在集群路由中回复 Ask

我正在创建一个项目,此时有一个演员(用户)通过一致的哈希组路由器调用另一个演员(音乐会)。一切正常,但我的问题是音乐会演员我无法回答询问消息。不知何故,消息丢失了,客户端什么也没有发生。我已经尝试了一切都没有运气:

  • Sender.Tell <-- 创建一个时间?发件人
  • 通过消息中的引用传递用户 IActorRef 并使用它。

这是完整的代码:https ://github.com/pablocastilla/AkkaConcert

主要细节如下:

用户演员:

客户端HOCON配置:

在后端:

演员已创建

音乐会演员消息处理

后端的 HOCON 配置:

谢谢!

0 投票
1 回答
427 浏览

c# - Unable to communicate between actors in Akka.Cluster

I am having some problems in communicating between actors in Cluster.

My test project has this structure below.

TestJob [C# Console Project]

  • TestJobService.cs
  • TestJobActor

MainProject [C# Console Project] //Note: I configured this service as a seed node. I didn't use lighthouse.

  • MainService
  • JobManagerActor

Note: I don't want to put actors in Shared project or Main project. The actors that are supposed to do a test job should be under "TestJob" project.

I already followed this article http://getakka.net/docs/clustering/cluster-overview and video. I did enable Akka.Cluster based on the article. I am able to run both console projects but when I tried to "tell" from JobManagerActor to TestJobActor, it doesn't work. No error but doesn't work.

I have this config in MainProject.

Here is the code that I use for sending the message.

What am I missing? Thanks in advance.

Note: My test project with similar structure can be found here https://github.com/michaelsync/APMDemo . (VS2015 project)

One more question: Can we still use the actor selection when using cluster?

0 投票
2 回答
359 浏览

akka.net - 如何使 akka-tree 与 akka.net 集群一起工作?

我目前正在寻找 akka.net(.NET 版本)的可视化工具。我没有找到,所以我想知道是否有任何方法可以使 akka-tree(规模)和 akka.net 集群一起工作。我想如果两个框架都遵循相同的规范,那么它应该可以工作。是吗?

我尝试在 akka-tree 中问这个问题,但没有回应,所以我在这里试试运气。

https://github.com/nraychaudhuri/akka-tree/issues/15

我不熟悉规模,但我做了以下更改。

我尝试在我的 akka.net 示例中添加 UDP 配置,因为我认为这个可视化工具正在使用 UDP。

然后,我尝试更改此文件 akka-tree\visualizer\app\controllers\Application.scala 中的 IP 地址

但是,不起作用..知道如何使它起作用吗?谢谢!

更新:

我尝试使用 TCP 但不起作用。

当我访问网页“localhost:90000”时出现以下异常。我对Scale不熟悉,但我认为它与Scale安装有关。我确实在我的机器上安装了 scale 和 java..

[信息] 将 1 个 Scala 源代码编译到 D:\git\akka-tree\visualizer\target\scala-2.11 \classes... [信息] 播放 - 应用程序已启动 (Dev) [错误] 应用程序 -

!内部服务器错误,用于 (GET) [/] ->

java.lang.ExceptionInInitializerError: null at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.appl y(routes_routing.scala:72) ~[na:na] at Routes$$anonfun$routes $1$$anonfun$applyOrElse$1$$anonfun$apply$1.appl y(routes_routing.scala:72) ~[na:na] at play.core.Router$HandlerInvokerFactory$$anon$13$$anon$14.call(Router. scala:217) ~[play_2.11-2.3.7.jar:2.3.7] 在 play.core.Router$Routes$TaggingInvoker.call(Router.scala:464) ~[play_2.11-2.3.7.jar: 2.3.7] 在 Routes$$anonfun$routes$1$$anonfun$applyOrElse$1.apply(routes_routing.scala:72) ~[na:na] 引起:java.net.SocketException:不是 java.net 的多播地址.MulticastSocket.joinGroup(Unknown Source) ~[na:1.8.0_51] at controllers.Application$.(Application.scala:16) ~[na:na] at controllers.Application$.(Application.scala) ~[na:na] at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.appl y(routes_routing.scala:72) ~[na:na]在 Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.appl y(routes_routing.scala:72) ~[na:na] [error] application - 渲染默认错误页面时出错 scala.MatchError : java.lang.ExceptionInInitializerError (of class java.lang.Exce ptionInInitializerError) at play.api.GlobalSettings$class.onError(GlobalSettings.scala:148) ~[play y_2.11-2.3.7.jar:2.3.7]在 play.api.DefaultGlobal$.onError(GlobalSettings.scala:206) [play_2.11- 2.3.7.jar:2.3.7] 在 play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:63 ) [play_2.11-2.3.7.jar:2.3.7] 在 play.core.server.Server$$anonfun$getHandlerFor$4。apply(Server.scala:7 3) [play_2.11-2.3.7.jar:2.3.7] 在 play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:7 1) [play_2 .11-2.3.7.jar:2.3.7] [错误] 应用程序 -

!内部服务器错误,对于 (HEAD) [/] ->

java.lang.NoClassDefFoundError: 无法在 Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.appl y(routes_routing.scala:72) ~[na:na 处初始化类控制器。 ] at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.appl y(routes_routing.scala:72) ~[na:na] at play.core.Router$HandlerInvokerFactory$$anon$13$ $anon$14.call(Router.scala:217) ~[play_2.11-2.3.7.jar:2.3.7] at play.core.Router$Routes$TaggingInvoker.call(Router.scala:464) ~[play_ 2.11-2.3.7.jar:2.3.7] 在 Routes$$anonfun$routes$1$$anonfun$applyOrElse$1.apply(routes_routing.scala:72) ~[na:na] [error] 应用程序 - 呈现默认时出错错误页面 scala.MatchError: java.lang.NoClassDefFoundError: 无法初始化类控制器.Application$(类 java.lang.NoClassDefFoundError) at play.api.GlobalSettings$class.onError(GlobalSettings.scala:148) ~[play y_2.11-2.3.7.jar:2.3.7] at play.api.DefaultGlobal$.onError(GlobalSettings.scala: 206) [play_2.11- 2.3.7.jar:2.3.7] 在 play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:63) [play_2.11-2.3.7.jar:2.3. 7] 在 play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:7 3) [play_2.11-2.3.7.jar:2.3.7] 在 play.core.server.Server$ $anonfun$getHandlerFor$4.apply(Server.scala:7 1) [play_2.11-2.3.7.jar:2.3.7]logExceptionAndGetResult$1(Server.scala:63) [play_2.11-2.3.7.jar:2.3.7] at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:7 3) [play_2 .11-2.3.7.jar:2.3.7] 在 play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:7 1) [play_2.11-2.3.7.jar:2.3. 7]logExceptionAndGetResult$1(Server.scala:63) [play_2.11-2.3.7.jar:2.3.7] at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:7 3) [play_2 .11-2.3.7.jar:2.3.7] 在 play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:7 1) [play_2.11-2.3.7.jar:2.3. 7]

0 投票
3 回答
2415 浏览

c# - Akka.net DI - 如何通过 DI 注入两个演员?

我想做的是将两个演员(妈妈演员和爸爸演员)传递给儿童演员。由于使用演员参考而不是演员是最佳实践,因此我使用 IActorRef 为木乃伊演员和爸爸演员通过 DI 注入命名参数。但我收到“mummyActor 不是唯一的”错误。知道如何解决吗?

0 投票
1 回答
855 浏览

akka.net - Akka.net 集群循环组配置。不路由消息

我正在尝试配置一个集群组路由器,并想彻底检查我对“如何”工作的假设。

我在集群中有 2 个单独的节点,它们具有以下角色“mainservice”和“secondservice”。在“mainservice”中,我想使用循环组路由器向“secondservice”中的 Actor 发送消息。

在 akka hocon 配置中,我在 akka.actor.deployment 部分中有以下内容:

我基于文档的假设是,我可以在“mainservice”中创建一个“secondserviceproxy”actor,它可以循环处理将消息路由到我的“secondservice”的任何正在运行的实例。

我还假设 routees.path 属性意味着消息被发送到位于其 Actor 层次结构中的“secondservice”中的 Actor,如下所示:“/user/gateway”。

我的工作假设是否正确?由于此实现在“第二服务”中没有产生任何结果。

0 投票
1 回答
581 浏览

c# - 如何将 ClusterRouterPool 从 C# 转换为 HOCON 配置?

我正在学习 akka.net,并且可能会使用它来替换我们传统的消息驱动应用程序的一部分。

基本上我正在尝试将X 个节点加入到一个集群中。它是点对点类型,我可能会在一个节点上运行 X 个演员(同一个演员)。

如果我有 10 个作业(比如 SendEmailActor),理想情况下,我希望这 10 个作业中的每一个都在不同的节点上执行(平均分配负载)。

我有一个非常简单的控制台应用程序来演示。

我的 app.config 看起来像

我想使用 HOCON 并设置 akka.actor.deployment,但我无法让它工作。我不太了解routees.paths,以及它与actor.deployment/worker的关系,以及 routees.paths如何映射到用 C# 创建的演员。

另一个问题:使用 aka.net.cluster 是否可以“镜像”节点以提供冗余?或者 GuaranteedDeliveryActor(我认为它已重命名为 AtLeastOnceDelivery)是要走的路吗?

0 投票
1 回答
672 浏览

c# - 如何在部署在不同集群节点上的两个相同参与者之间保持状态?(阿卡网)

如果我有如下设置,假设我将有 3 个节点加入集群,并且我使用循环池。

“工人”只记得它已经处理了多少条消息,如下所示

无论如何要在不同集群节点上的不同参与者之间同步“已处理列表”?这是 akka.net.cluster.sharding 最终会做的事情吗?还是我在做一些完全没有意义的事情?

0 投票
1 回答
668 浏览

azure - Sending Akka.net cluster gossip to Azure worker role console

I'm developing an Azure cloud service including multiple worker roles that form an akka.net cluster. How do I accomplish getting the cluster gossip and other messages end up in the compute emulator console windows?

0 投票
1 回答
1071 浏览

akka.net - Akka.NET - 集群和 ActorSelection 路径

我有一个 akka.net 集群,我想向本地和远程的参与者发送消息,并且所有参与者都具有路径“/user/foobar”(至少在本地)。我应该使用 ActorSelection,路径应该是什么样子才能同时定位匹配的本地和远程演员?

0 投票
1 回答
964 浏览

akka.net - Node doesn't rejoin cluster after being downed

I'm using Akka.NET's cluster (1.0.5) functionality to implement a service that consists of a master node that receives requests over HTTP and farms the work out to worker nodes that have joined the cluster.

The idea is to be able to easily accomplish the following:

  • add worker nodes to cluster when demand is high (check)

  • be able to reboot the master node or take it offline (maintentance/misbehaviour/whatever) and have the workers reconnect when it becomes available (check)

  • upgrade/reboot a misbehaving worker and have it reconnect to the master node (fail!)

The first point works as you'd expect: a new instance (Azure Cloud Service worker role) is spun up, and joins the master - which is also the seed node.

For the second point, all worker nodes have an actor that listens to cluster gossip and it determines if the master node has died. If this is the case, the worker node actor system will be rebooted.

The last point is where I'm stuck. The master node also listens to cluster gossip to determine when a worker has become unreachable (ClusterEvent.UnreachableMember) or is shutting down (Exiting status) and decides if it should be downed. According to what I've understood from documentation, the only way to have a "new" version of the same node rejoin the cluster is to down the old version first.

Unfortunately this doesn't seem to be happening. In the test scenario I ran to reproduce the problem locally in the compute emulator, these were the steps:

  1. Start the master node (port 8090)

  2. Start the worker node (port 9090)

  3. Do some work

  4. Kill the worker node abruptly

  5. Start the worker node back up

Below are relevant snippets from the logs I collected for both nodes during this test:


Master:

Worker becomes unreachable:

Master node calls Cluster.Leave() and Cluster.Down() on the worker's address:

Master confirms the old node will no longer be allowed to join (seems to have a bug though, see the first line - gated instead for akka.tcp://InventoryService@0.0.0.0:9090 ms, which I imagine would be the time it is supposed to be gated):

Worker boots and tries to connect to the master:

What is happening here?


Worker:

Booting back up after being killed:

And thats it...nothing else gets written to the log!


Full log files:

Master cluster config:

Worker's config is the same, but only has the InventoryServiceWorker role.

What am I missing here? Is this a configuration problem? (I'm hoping its not a bug - I've seen someone else report a similar problem on Github).

EDIT:

Just to be clear, I'm not using the Akka.dll from Nuget since it contains a serialization bug - I checked ou the current master applied the fix and did a Release build. The logs have debug information because I kept the PDB from the build.

EDIT 2:

In the worker log, after rebooting, the event Akka.Cluster.InternalClusterAction+JoinSeedNodes appears twice because I originally had a manual call to Cluster.JoinSeedNodes(). I've since removed this but the result is still the same.