1
votes

I've created a simple erlang release using rebar, following this tutorial: http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades

I can install and start the dummynode by going to the dummynode/bin folder and running:

dummynode install
dummynode start

In the vm.args file, I've set the node name to [email protected]

When I start another node with:

erl -name [email protected] -setcookie dummynode

I can then launch the erlang observer. In the "Nodes" menu, I see that the dummynode node is listed, but when I try to connect, observer crashes.

I can't make heads or tails of the crash dump file, but it seems like erlang is complaining about distribution not being enabled.

I cannot connect the nodes with net_adm:ping/1 and can't figure out why observer was able to at least see the detached dummynode node.

Can anyone explain how I can connect to the dummynode node?

UPDATE: I've confirmed that the cookies are the same on both nodes. Also, AFAICT rebar is packaging observer and all of it's dependencies into the release.

3

3 Answers

0
votes

If you cannot connect with net_adm:ping/1 check that both nodes have the same cookie (erlang:get_cookie/0).

The 2 nodes must have the same cookie to form a distributed system, but observer can show you at least all the nodes that are present on your machine, even if they have not the samme cookie.

0
votes

Observer needs some modules installed on remote node to run. It crashes silently if they are not presented there. I don't remember which ones it was so you have to experiment so add some application requirements to your target distribution.

0
votes

Mystery solved! It was neither a cookie nor dependency issue. The generated vm.args file has a line:

-name [email protected]

Which you'd think would mean that if I change the node name to something like

-name [email protected]

then rebar would start the runtime with the flag:

erl -name [email protected]

This is not the case. It turns out that rebar always invokes the runtime (at least on windows) with the -sname flag, even if you adjust the node name. If you want to distribute your cluster across physical machines (using long names with the -name flag) you need to edit the generated bin\dummynode.cmd file, and change all of the -sname flags to -name.

I've filed an issue with the rebar team, but I don't know if they consider this to be a bug or not.