0
我嘗試在一個maschine在兩個節點上運行我的應用程序的集羣上運行鳳凰城項目: https://dockyard.com/blog/2016/01/28/running-elixir-and-phoenix-projects-on-a-cluster-of-nodes節點
我創建配置文件:
[{kernel,
[
{sync_nodes_optional, ['[email protected]', '[email protected]']},
{sync_nodes_timeout, 10000}
]}
].
我(從1號航站樓)運行:
elixir --name [email protected] --erl "-config sys.config" -S mix phoenix.server
,然後(從終端2):
elixir --name [email protected] --erl "-config sys.config" -S mix phoenix.server
,我得到:
** (Mix) Could not start application app: App.start(:normal, []) returned an error: shutdown: failed to start child: App.Endpoint
** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Server
** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, App.Endpoint.HTTP}
** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup
** (EXIT) {:listen_error, App.Endpoint.HTTP, :eaddrinuse}
我做錯了什麼?
@Wulpo那是不可能的。有關更多信息,請參閱http://stackoverflow.com/questions/1694144/can-two-applications-listen-to-the-same-port。 – Gazler
它正在工作,但我的第一個意圖是:在2臺PC上運行2個應用程序實例並使用一個URL。 當我更改端口時,它將是「不同」的應用程序。 (分發編程/計算) – Wulpo
@Wulpo如果你在兩臺不同的物理機器上運行,那麼你可以在同一個端口上運行它們。 – Gazler