从akka路由器检测远程节点的故障

编程入门 行业动态 更新时间:2024-10-07 21:35:12
本文介绍了从akka路由器检测远程节点的故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

让我们说我有一个配置为在多个远程节点上创建参与者的路由器。也许我有这样的配置:

Lets say I have a router which is configured to create actors on multiple remote nodes. Perhaps I have a configuration like this:

akka { actor { deployment { /fooRouter { router = round-robin resizer { lower-bound = 2 upper-bound = 10 } target { nodes = ["akka://mana@10.0.1.1:2555", "akka://mana@10.0.1.2:2555"] } } } }

如果我们假装这些节点之一10.0.1.1由于某种原因丢失了与数据库服务器的连接,因此传递给它的所有消息都将导致失败。路由器是否可以通过某种方式知道10.0.1.1节点实际上是无用的并停止使用它?

If we pretend that one of these nodes, 10.0.1.1, for some reason, has lost connectivity to the database server, so all messages passed to it will result in failure. Is there some way that the router could come to know that the 10.0.1.1 node as effectively useless and stop using it?

推荐答案

不,目前没有。您可以让发生故障的节点上的角色自杀,但是一旦调整器启动新角色,它们就会重新出现。即使有了集群支持(即将推出),这也不是自动的,因为与某些外部资源的连接不是集群可达性指标的一部分。这意味着您将必须编写代码,使该节点显式下降,然后可以将actor迁移到其他节点(细节尚未完全充实)。

No, currently there is not. You can have the actors on the failed node commit suicide, but as soon as the resizer starts new ones, they will reappear. Even with clustering support—which is yet to come—this would not be automatic, because connections to some external resource are not part of the cluster’s reachability metric. This means that you would have to write code which takes that node down explicitly, upon which the actors could be migrated to some other node (details are not yet fully fleshed out).

所以,当前,您必须将自己的路由器编写为真正的角色,这要考虑到可达性。

So, currently you would have to write your own router as a real actor, which takes reachability into account.

更多推荐

从akka路由器检测远程节点的故障

本文发布于:2023-11-25 11:46:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629616.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   路由器   故障   akka

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!