Background
I'm trying to setup clustering between a few elixir nodes. My understanding is that I can set this up by modifying the release vm.args. I'm using Distillery to build releases and am following the documentation here: https://hexdocs.pm/distillery/config/vm.args.html.
My rel/vm.args
file is as follows:
-name <%= release_name %>@${HOSTNAME}
-setcookie <%= release.profile.cookie %>
-smp auto
-kernel inet_dist_listen_min 9100 inet_dist_listen_max 9155
-kernel sync_nodes_mandatory '[${SYNC_NODES_MANDATORY}]'
I have a build server running Ubuntu 18.04 and two webservers running Ubuntu 18.04. I'm building the release on the build server, copying the archive to the webservers and, unarchiving it and starting it there.
Problem
When I build my release and try to run it on the webserver I get the following error on startup:
Failed setting -name! The hostname in 'myapp@' is not fully qualified
The documentation linked above states:
The ${HOSTNAME} and ${NODE_COOKIE} parts will only be dynamically replaced at runtime if you export REPLACE_OS_VARS=true in the system environment prior to starting the release, so be sure you do so if you want to use this approach.
Based on that I added REPLACE_OS_VARS=true
to the webserver environment, but it seems to have no affect. I also added it to the environment on the build server out of desperation but got the same results.
Is there anything else that needs to be done other than setting this environment variable to get the dynamic vm.args to work or am I just missing something here?