Naming Your Elixir Node
To make clustering easier, we want our Elixir nodes to be named using our Fly application name and the IPv6 address assigned to the node. Then later, our cluster can form up using DNS settings based on this naming scheme.
Naming the Node
In your Elixir application, run this command:
Then edit the generated
rel/env.sh.eex file and add the following lines:
ip=$(grep fly-local-6pn /etc/hosts | cut -f 1) export RELEASE_DISTRIBUTION=name export RELEASE_NODE=$FLY_APP_NAME@$ip
This names our Elixir node using the Fly application name and the internal IPv6 address. Make sure to deploy after making this change!
Nice! Our application is ready for clustering!
Next up, Clustering!