Akka Cluster Autodiscovery

375 views
Skip to first unread message

Geoff Groos

unread,
Sep 4, 2015, 4:02:02 PM9/4/15
to Akka User List
Hey guys,

We need to deploy akka to a particularly tricky environment. What I would like to do is provide our customers with two installers, a driver installer (that contains the bulk of our software, including an akka job-ordering component), and a worker installer (includes an akka listen-and-generate-results component). Ahead of time we don't know much about the network we're deploying to, which means that when we give them the deliverable we don't have any IP addresses to use as seed nodes.

This means I would really like something along the lines of:

     val cluster = Cluster(context.system, password = privateProps.get("password"), workgroupName = localProps.get("workgroupName"))

With the workgroupName providing a auto discovery (any actor created with the same workgroup name would be on that cluster), and a password providing some amount of authentication. I could then prompt the user for the password and workgroup names at installation time, saving them as appropriate.

It seems that AKKA does not support autodiscovery, but whats annoying to me is that I cant find any dialog at all on it outside of an errant remark on a pull request, does anybody else want this feature? Has it been discussed somewhere?

I was thinking about using JGroups as an initial strategy to collect the seed node and worker node IP's for akka's configuration, then starting akka. Does this sound sane?

I should mention that we're also fumbling with JPPF in an attempt to get the same thing to happen. Progress is slow on that front, and I'd really like to be able to show off a nifty piece of scala that does almost the same thing with 10x less code, but I need some way of discovering workers & drivers without knowing their IP addresses.

thanks for any help!

-Geoff

Akka Team

unread,
Sep 8, 2015, 6:31:54 AM9/8/15
to Akka User List
Hi Geoff,

Akka does not have an autodiscovery feature, but you can implement such a service yourself as Akka Clustering allows for programmatic joining, where you can pass an arbitrary list of nodes as argument:

"You may also use Cluster(system).joinSeedNodes to join programmatically, which is attractive when dynamically discovering other nodes at startup by using some external tool or API. When using joinSeedNodes you should not include the node itself except for the node that is supposed to be the first seed node, and that should be placed first in parameter to joinSeedNodes."

(http://doc.akka.io/docs/akka/2.3.13/scala/cluster-usage.html#Joining_to_Seed_Nodes)

Sinca Akka is a library, you can easily integrate with any technology you would like to use (for example UDP multicast groups) for autodiscovery.


I was thinking about using JGroups as an initial strategy to collect the seed node and worker node IP's for akka's configuration, then starting akka. Does this sound sane?

Yes, that can work. The only thing that can bite you is that in the list of seed nodes the first entry serves a special role during the startup of the cluster (i.e. when there is not yet an existing cluster). You should make sure that during bootstrap all the nodes see the same entry as the first node in this list. Once the cluster is running (i.e. bootstrap finished and there is at least one surviving member is left) this is no longer needed, this is only for the initial formation.

-Endre
 

I should mention that we're also fumbling with JPPF in an attempt to get the same thing to happen. Progress is slow on that front, and I'd really like to be able to show off a nifty piece of scala that does almost the same thing with 10x less code, but I need some way of discovering workers & drivers without knowing their IP addresses.

Technically, you don't need to know the IP address of all nodes, you only need a small subset that can "introduce" new members to the "club", i.e. initial contact points (just like any P2P networks needs these). Akka does not assume the existence of a local broadcast/multicast region therefore it needs these initial contact points. If you can assume that you have UDP multicast available locally, then you can use this extra information and feed Akka with the discovered node list.

-Endre
 

thanks for any help!

-Geoff

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam
Reply all
Reply to author
Forward
0 new messages