Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Elixir node without using IEx?

Tags:

elixir

When using Elixir’s interactive shell IEx, I can create a node by command:

iex --sname node_name

But how can I create a node by code, then run the code by:

elixir code.exs

There are some function like node(), but it seems that those function just return a node existed.

like image 697
Nai Avatar asked Jun 01 '26 11:06

Nai


1 Answers

Use

elixir --sname node_name

Generally, you pass the node name so that everything starts up knowing its own name. However, it is apparently also possible to set the name while running with the Erlang net_kernel module, as described in the answer to How set Erlang node name...

like image 177
Nathaniel Waisbrot Avatar answered Jun 03 '26 13:06

Nathaniel Waisbrot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!