通过ssh运行erlang发行版的remote_console很奇怪

时间:2017-05-18 00:22:11

标签: ssh erlang elixir

我在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.

我不明白为什么会有所不同。

0 个答案:

没有答案