我在EC2 ubuntu上通过systemd
运行我的elixir应用程序的erlang版本。
当我尝试通过ssh运行我的应用程序的remote_console
时,它很奇怪。
# Good way. Connect to EC2 and run remote_console
$ ssh ubuntu@<ip>
$ sudo myapp remote_console
iex(myapp@127.0.0.1)> Application.started_applications()
... # All of my applications. OK.
# Bad way. Run remote_console via ssh command
$ ssh ubuntu@<ip> sudo myapp remote_console
iex(remshce50beca-myapp@127.0.0.1)> Application.started_applications()
[{:logger, 'logger', '1.4.1'}, {:iex, 'iex', '1.4.1'},
{:elixir, 'elixir', '1.4.1'}, {:compiler, 'ERTS CXC 138 10', '7.0.4'},
{:stdlib, 'ERTS CXC 138 10', '3.3'}, {:kernel, 'ERTS CXC 138 10', '5.2'}]
# Weird node name remshce50beca-myapp and only 3 applications are started.
我不明白为什么会有所不同。