Akka远程actor服务器发现 [英] Akka remote actor server discovery

查看:133
本文介绍了Akka远程actor服务器发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在群集上部署使用akka制作的远程actor软件。该系统由几个工作程序节点和一个主节点组成。问题是我无法事先知道群集节点的IP地址(但我知道它们都属于同一子网)。因此,我需要一种很好的方法来在启动后发现每个人的IP地址,以便在每个节点上创建正确的actor引用。

I would like to deploy a remote actors software made with akka on a cluster. The system is composed of several worker nodes and a single master node. The problem is that I cannot know in advance the IP address of the cluster nodes (but I know they are all part of the same subnetwork). So, I need a nice way of discovering the IP address of everyone after startup, to create the correct actor refs on each node.

我正在寻找一种轻量级的解决方案(

I am looking for a ligtweight solution (I just need it for the initial setup) distributed under any free software license.

推荐答案

前一段时间,我创建了 原型 ,旨在解决您的问题(随意重用代码和/或

A while ago I created a prototype that's intended to solve your problem (feel free to reuse the code and/or contribute).

关于它如何工作的几句话。它为每个参与者注册表(= node)启动一个远程参与者。 RegistryActor包含指向在分布式安装程序中运行的所有其他注册表的链接。将新节点添加到系统后,它需要知道至少一个其他节点(ActorRegistry)并进行通知。然后,ActorRegistry会让所有其他节点知道新节点(因此,任何RegistryActor都具有到所有其他RegistryActor的链接),并开始交换与参与者的链接的过程-最后,所有参与者注册表都具有与所有参与者的链接(

A few words on how does it work. It starts a remote actor for each actor registry (=node). RegistryActor holds links to all the other registries running in a distributed setup. When a new node is added to the system, it needs to know about at least one other node (ActorRegistry) and notify it. ActorRegistry than lets all other nodes know about the new one (thus, any RegistryActor has links to all other RegistryActor's), and starts a process of exchanging links to actors - at the end of it, all the actor registries have links to all actors (either local or remote) running in a system.

有关更多详细信息,请参阅此 博客文章

For more details, please refer this blogpost.

这篇关于Akka远程actor服务器发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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