我想连接2个不同码头集装箱的节点。如何连接elixir中的两个docker容器的节点?
Container1:iex --name [email protected] --cookie foo
container2的:iex --name [email protected] --cookie foo
现在可以说,我想从[email protected]
container2的连接[email protected]
:
iex([email protected])> Node.connect(:"[email protected]")
iex([email protected])> true
节点越来越连接。但如果我做
iex([email protected])> node = "[email protected]"
iex([email protected])> Node.connect(:node)
iex([email protected])> false
为什么我得到错误?其他功能也会发生这种情况,例如Node.spawn/2。
和怎么样'节点=:“[email protected]”'然后'Node.connect(节点)' – Pascal
的建议:不要使用IP地址,使用的名称,让泊坞窗自动连接您的容器。 – papey
@帕斯卡,方法将工作,我只是测试它 –