Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka-remote over the Internet

Tags:

scala

akka

p2p

nat

I'm writing distributed BBS software using Akka 2.2.3 as remote message passing in Scala.

Then, I've found some problem in networking over the Internet through NAT: Akka doesn't recognize external IP address, AFAIK because it uses socket.bind.

Next, I thought that I can specify 0.0.0.0 as akka.remote.netty.tcp.hostname in order to adopt all interfaces and addresses to listen connections from the Internet side.

Here is the problem -- Akka uses 0.0.0.0 as its own IP address, and generates ActorRef like this: akka.tcp://[email protected]/user/foo.

Other nodes cannot refer the node using this ActorRef over the Internet. What should I do for connecting nodes over the Internet? Can't I use Akka over NAT?

like image 371
Windymelt Avatar asked Mar 22 '14 09:03

Windymelt


People also ask

How does Akka remoting work?

Akka has two ways of using remoting: Lookup : used to look up an actor on a remote node with actorSelection(path) Creation : used to create an actor on a remote node with actorOf(Props(...), actorName)

What is cluster in Akka?

Akka Cluster provides a fault-tolerant decentralized peer-to-peer based Cluster Membership Service with no single point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.


1 Answers

Akka remoting does not support NAT, which is intentional since its purpose is just to enable clustering (i. e. symmetrical communication between a tightly controlled set of nodes). There are several protocols that have been devised for Internet-wide use, e. g. HTTP/REST (see Spray which is becoming Akka HTTP) or bare TCP using Akka IO.

like image 54
Roland Kuhn Avatar answered Sep 23 '22 02:09

Roland Kuhn