1

I have two nodes with different cookies. I am trying to make a call, as written below, but i am getting {badrpc,nodedown} everytime.

onenode@localhost>rpc:call(othernode@localhost,erlang,system_info,[otp_release]).

I have tried finding on google and ended up at following links to try them out but still "no success".

Here are some of the links i tried :

Link 1

Link 2

Link 3

Can you please help me out.

EDIT -1 : Both the nodes are hosted in localhost.

Madhusudan Joshi
  • 4,438
  • 3
  • 26
  • 42

2 Answers2

2

You have to execute following function before execute the rpc call to a node with different cookie

erlang:set_cookie(other_node@localhost, other_node_cookie).

More info : http://erlang.org/doc/reference_manual/distributed.html

David Sulc
  • 25,946
  • 3
  • 52
  • 54
1

According to the rpc.erl, It makes a generic erlang call using gen_server module and gen_server uses gen.erl module for call and here it uses noconnect option as options of erlang:send/3.
According to the Erlang documentation:

If the destination node would have to be auto-connected to do the send, noconnect is returned instead.

The other problem is different cookies. According to Erlang documentation:

When a node tries to connect to another node, the magic cookies are compared. If they do not match, the connected node rejects the connection.

So if there is not any connection between nodes, your call does not create one and you can't connect Erlang nodes with different cookies.

Pouriya
  • 1,626
  • 11
  • 19