I'm testing erlang remote code loading via -loader inet option without the slave option.
Two elixir emulators (consoles) on the same box for now. The master running a custom project:
Master
shell> iex --sname master --cookie abc123 -S mix
master iex> :erl_boot_server.start([{127,0,0,1}])
{:ok, #PID<0.134.0>}
The other running bare:
Worker
shell> iex --sname worker --cookie abc123 --erl "-hosts 127.0.0.1 -id worker -loader inet"
worker iex>
How does exacly the automatic remote code loading suppose to work? When I try to load module on the worker I get:
worker iex> Code.ensure_loaded(MyModule)
{:error, :nofile}
On the master this does work:
master iex> Code.ensure_loaded(MyModule)
{:module, MyModule}
I know the worker node does find the master and connect to it's boot server because when the master is not present, I get the message:
{erl_prim_loader,'no server found'}
I have tried also to add all the code paths to the worker via Code.append_path but still when I try to load the module it does not find it.
1条答案
按热度按时间q9yhzks01#
尝试在您的主服务器上运行此命令:
完成后,您应该能够在worker节点上自动加载代码。