I am trying to connect 2 nodes of different docker containers.
Container1: iex --name [email protected] --cookie foo
Container2: iex --name [email protected] --cookie foo
Now lets say I want to connect to [email protected]
from [email protected]
Container2:
iex([email protected])> Node.connect(:"[email protected]")
iex([email protected])> true
Nodes are getting connected. But if I do
iex([email protected])> node = "[email protected]"
iex([email protected])> Node.connect(:node)
iex([email protected])> false
Why I am getting error? This is happening with other functions as well such as Node.spawn/2.
I got it working by converting the string into atom.
iex([email protected])> node = "[email protected]"
iex([email protected])> Node.connect(String.to_atom(node))
iex([email protected])> true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With