从akka路由器检测远程节点的故障 [英] detecting failure from remote nodes from an akka router

查看:83
本文介绍了从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路由器检测远程节点的故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆