Search code examples
erlangrpcerlang-shellerl

Erlang {badrpc,nodedown} error while making rpc:call


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.


Solution

  • 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