2016-11-04 170 views
0

我在遠程計算機上,它上面有一個正在運行的Erlang VM節點。我試圖通過iex連接到二郎山VM節點,但得到一個錯誤回來:連接到遠程節點

$ iex --name [email protected] --remsh [email protected] --setcookie NMFJGSU0FwvGKlrqMuGfY1I6LtgSz1Rn2PLiDnqMS54 
Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [async-threads:10] [kernel-poll:false] 

Could not contact remote node [email protected], reason: :nodedown. Aborting... 
$ 

epmd -names報告二郎山VM節點正在運行:

$ epmd -names 
epmd: up and running on port 4369 with data: 
name myapp at port 45671 
$ 

這裏的部署應用程序的vm.args內容:

-name [email protected] 
-setcookie NMFJGSU0FwvGKlrqMuGfY1I6LtgSz1Rn2PLiDnqMS54= 
-smp auto 

問題:我做錯了什麼?

回答

4

您需要將相同的cookie傳遞到iex作爲一個在vm.args

iex --name [email protected] --remsh [email protected] --cookie NMFJGSU0FwvGKlrqMuGfY1I6LtgSz1Rn2PLiDnqMS54= 

如果cookie不正確,你會得到一個:nodedown錯誤。

從殼牌#1:

$ iex --cookie foo --name [email protected] 

從殼牌#2:

$ iex --name [email protected] --remsh [email protected] 
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Could not contact remote node [email protected], reason: :nodedown. Aborting... 
$ iex --name [email protected] --remsh [email protected] --cookie foo 
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Interactive Elixir (1.3.4) - press Ctrl+C to exit (type h() ENTER for help) 
iex([email protected])1> 
+0

對不起,我沒有具體說明,但實際上,我是路過的cookie。我會更新我的問題。 – gmile

+0

你使用過'--setcookie'還是'--cookie'?它應該是'--cookie'用於'iex'。而且你似乎也錯過了最後一個'='(或者在編輯中犯了一個錯字)。 – Dogbert

+0

你完全正確!我完全錯過了我使用了錯誤的鑰匙。現在一切正常,謝謝你:) P.S.並感謝您指出缺少的'='符號! – gmile