Hello guys,
I have my app built up, and now I’m wondering, how can I run two instances (on two servers) of the distillery release and connect them into Elixir node-cluster.
I set up an application as this guy here --> Cluster Phoenix with Docker
But, when I run HOST=172.31.56.165 PORT_SSL=4000 REPLACE_OS_VARS=true NODE_NAME=prod01@217.0.0.1 _build/prod/rel/myapp_phoenix/bin/myapp_phoenix foreground
For first node and then
HOST=172.31.56.165 PORT_SSL=4000 REPLACE_OS_VARS=true NODE_NAME=prod02@127.0.0.1 _build/prod/rel/myapp_phoenix/bin/myapp_phoenix foreground
for the second
IDK how to run Node.connect (or whatever, IDK even how to run the console, which will be running in same “context” as the apps)
And secondly, as far as I understand if I have those apps running like this, they are a standalone instances. In other words, they are not seeing each other in EVM, therefore I can’t for example broadcast in Phoenix channel from one to other(s). --> so I need somehow to connect them.
I’m trying to do some POC on localhost, but then I want to run apps separately on docker.
I also tried an approach from Cris’s article here https://dockyard.com/blog/2016/01/28/running-elixir-and-phoenix-projects-on-a-cluster-of-nodes
to do something like elixir --name n1@127.0.0.1:4001 --erl "-config sys.config" PORT=4001 -S /path/to/release
But it’s not working (obviously), either.
Can anyone please, help me??
Thanks in advance.