制作 rpc:call 时 Erlang {badrpc,nodedown} 错误

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

我有两个节点有不同的 cookie。我正在尝试拨打电话,如下所示,但我每次都收到 {badrpc,nodedown}。

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

我已经尝试在 google 上找到并最终通过以下链接进行尝试,但仍然 "no success"。

以下是我试过的一些链接:

Link 1

Link 2

Link 3

你能帮帮我吗?

编辑-1:两个节点都托管在本地主机中。

根据 rpc.erl, It makes a generic erlang call using gen_server module and gen_server uses gen.erl module for call and here 它使用 noconnect 选项作为 erlang:send/3 的选项。
根据 Erlang 文档:

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

另一个问题是不同的 cookie。根据 Erlang 文档:

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.

因此,如果节点之间没有任何连接,您的调用不会创建连接,并且您无法使用不同的 cookie 连接 Erlang 节点。

在对具有不同 cookie 的节点执行 rpc 调用之前,您必须执行以下函数

erlang:set_cookie(other_node@localhost, other_node_cookie).

更多信息:http://erlang.org/doc/reference_manual/distributed.html