jdj_dk
Hi everyone.
I’m trying to setup a small cluster with three nodes. I’m using libcluster as I have before. But my nodes doesn’t have a usable hostname. The VPS came with a hostname like this: ip-123-123-123-123. I’ve changed the hostname on the VPS but it doesn’t get picked up in the app when I restart it. I’ve restarted the server. And i can see that the hostname has changed on the server it self.
I’m seeing in the logs when it starts that it’s using the old hostname, which included the IP of the vps. So I get this error:
21:36:48.538 [error] ** System running to use fully qualified hostnames **
: ** Hostname ip-x-x-x-x is illegal **
The app is built using Mix release. From the docs I can see that I should be able to set RELEASE_DISTRIBUTION and RELEASE_NODE env variables. I’ve set them to the following:
RELEASE_DISTRIBUTION=name
RELEASE_NODE=app_name@host.url.com
I would assume doing so would force change the hostname in the app as well. But it doesn’t seem to be the case. What am I missing. Thanks in advance ![]()
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
This is what I found when looking for what makes an hostname valid as opposed to illegal. Maybe you’re missing the resolvable and reachable part.
https://github.com/bitwalker/distillery/issues/338#issuecomment-334848537
jdj_dk
Thanks for your answer.
The hostname is indeed resolvable and reachable. But it doesn’t seem to pick up the hostname at all in my app. That’s the problem I think.
It keeps using the original hostname the VPS had when it was first setup. Now the hostname has changed to something that is reachable from the outside world as well. But it doesn’t seem to pick up the host name even though I set it explicitly with tne
RELEASE_NODEenv variable.NobbZ
Where and how did you change those?
jdj_dk
I changed the hostname in
/etc/hostnameand rebooted the server.The
RELEASE_NODE&RELEASE_DISTRIBUTIONenv variables is set in the systemd service responsible for keeping the app runningExadra37
If the output of both
hostnameandhostname -fare not the same then I think your hostname is not set properly.Try to set it with:
jdj_dk
Thanks for your input.
The output of both
hostnameandhostname -fare the same.I tried setting the hostname with your command. Sadly it didn’t make any difference.
Exadra37
Maybe moving the Elixir configuration for
httpandurland anything not related with compile time settings intoruntime.exsand build a new release can help?jdj_dk
Yeah I already did that and that works fine. But the node it self doesn’t get the correct host.
Exadra37
So, how are you setting up the nodes configuration?
jdj_dk
What exactly do you mean by nodes configuration? Then only thing I’m trying now is to make sure my node has the right hostname (using
RELEASE_NODE&RELEASE_DISTRIBUTION) so I can connect to it from another node. After that I’m setting uplibcluster.