jdj_dk

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 :slightly_smiling_face:

Showing Posts 1 to 10

LostKobrakai

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.

Long names need the hostname to be resolvable and reachable, in other words it needs to either be an IP address or a valid DNS name. In the case of an IP address, it is already resolved so it only needs to be reachable from the current host. In the case of a DNS name, it needs to be resolvable by any one of the DNS resolution mechanisms on the host (/etc/hosts, /etc/resolve.conf, etc.) to an IP address which is reachable from the current host.

https://github.com/bitwalker/distillery/issues/338#issuecomment-334848537

jdj_dk

jdj_dk OP

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_NODE env variable.

NobbZ

NobbZ

Where and how did you change those?

jdj_dk

jdj_dk OP

I changed the hostname in /etc/hostname and rebooted the server.

The RELEASE_NODE & RELEASE_DISTRIBUTION env variables is set in the systemd service responsible for keeping the app running

Exadra37

Exadra37

If the output of both hostname and hostname -f are not the same then I think your hostname is not set properly.

Try to set it with:

sudo hostnamectl set-hostname something.example.com
jdj_dk

jdj_dk OP

Thanks for your input.

The output of both hostname and hostname -f are the same.

I tried setting the hostname with your command. Sadly it didn’t make any difference.

Exadra37

Exadra37

Maybe moving the Elixir configuration for http and url and anything not related with compile time settings into runtime.exs and build a new release can help?

jdj_dk

jdj_dk OP

Yeah I already did that and that works fine. But the node it self doesn’t get the correct host.

Screenshot 2021-01-25 at 14.07.35

Exadra37

Exadra37

So, how are you setting up the nodes configuration?

jdj_dk

jdj_dk OP

So, how are you setting up the nodes configuration?

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 up libcluster.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews