The host name to create the erlang cluster

I am trying to create a cluster using Amazon EC2 instances.

Do I need to set the host name of each node to what is specified in the file .hosts.erlang?

Currently .hosts.erlangfor each node it has:

'ip-10-0-23-186.eu-central-1.compute.internal'.
'ip-10-0-5-10.eu-central-1.compute.internal'.

which are private DNS nodes.

and in the vm.argsnodes, I have something like this:

-name api@ip-10-0-5-10.eu-central-1.compute.internal 

I tried changing the host name to full private DNS, but it only changed to:

ip-10-0-5-10

I checked the cluster, got empty:

$ erl
Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]

Eshell V8.0  (abort with ^G)
1> nodes().
[]

I am deploying my application using edliver, how can I debug, why does erlang not create the expected cluster?

I tried in iex:

iex(3)> hosts_path = Path.expand("/home/admin/.hosts.erlang") 
"/home/admin/.hosts.erlang"
iex(4)> :net_adm.world(:verbose)
[]

change

I can confirm that .hosts.erlangyou can read:

iex(2)> File.read("/home/admin/.hosts.erlang")
{:ok,
 "'ip-10-0-23-186.eu-central-1.compute.internal'.\n'ip-10-0-5-10.eu-central-1.compute.internal'.\n\n"}

Is there a specific folder from which I have to run erl?

, , . , !

AWS, , :

enter image description here

+4
1

, , ip- hosts /etc/hosts node

10.0.23.186 ip-10-0-23-186.eu-central-1.compute.internal
10.0.5.10   ip-10-0-5-10.eu-central-1.compute.internal
+1

Source: https://habr.com/ru/post/1662127/


All Articles