jdj_dk

jdj_dk

My app does not pick up the changed hostname on my VPS

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:

Most Liked

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

NobbZ

NobbZ

No, the s in sname is for “short”. Some check in the BEAM will even error if there is a dot in a sname.

fsa

fsa

More straw grasping - you can try to put this at the top/start of some/any scripts you would like to debug:

set -x

it echoes results of the commands in the script file as it executes…

( you can also run it as:
sh -x scriptname
if you can’t/don’t want to edit the scripts themselves)

Best of luck.

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New

We're in Beta

About us Mission Statement