Aventor
Aventor

Reputation: 11

Connect to the Erlang node through DNS record

I have two nodes: 'test@rabbit001' 'test@rabbit002'.

There is a DNS record test which is a round robin between rabbit001 and rabbit002.

First, I try to connect to the node using it's hostname and it's fine:

(test@rabbit002)54> net_kernel:connect('test@rabbit001').
true

test@rabbit002 logs: http:// pastebin.com/yELBpE82

test@rabbit001 logs: http:// pastebin.com/iF23UPgf

Then when I try to connect to the node using that DNS record:

(test@rabbit002)57> net_kernel:connect('test@test').
false

test@rabbit002 logs: http://pastebin.com/M6FbUTDH

test@rabbit001 logs: http://pastebin.com/rfH0HsEK

Is it possible to make them communicate properly?

The networking is not a problem, I've confirmed that actual net_kernel functions are being called on 'test@rabbit001' when I try to do a net_kernel:connect from 'test@rabbit002'.

Upvotes: 1

Views: 141

Answers (1)

legoscia
legoscia

Reputation: 41568

No, it's not possible to use a round robin DNS record to balance Erlang inter-node communications. The node name is not only used to resolve the hostname, but the remote node must be using that exact same name. You'll have to implement some kind of load balancing in Erlang.

Upvotes: 1

Related Questions