erlang 分佈式編程問題

這兩天業餘研究下erlang,看concurrent programming 的tutorial,發現例子裏的ping pong在我這裏怎麼弄都運行不了(一個mac os開兩個shell),後來在郵件列表裏找到了答案,


只需在啓動節點的時候加個@localhost就ok了,可能是新版本的問題,網上好多老版本的demo沒這個問題。可能是改進吧。

http://erlang.org/pipermail/erlang-questions/2007-March/025836.html

考慮到國慶 把內容也貼下


P.S.: After some experimenting on my Windows XP PC (although with a
newer version of erlang), I found there using "erl -sname
" and "net_adm:ping('')." would work. Using
"@localhost" didn't fix the issue on CentOS/OpenVZ.

When I called "erl_epmd:names()." on the XP machine it would list the
two nodes (even if I'd started without "@localhost" for sname, but in
that case ping didn't work).

However trying "erl_epmd:names(). " on my CentOS/OpenVZ machine just
froze for a long time and then eventually gave "{error,address}".

For whatever it might be worth to any other folks :-}

On 2/28/07, Raoul Duke <> wrote:
> >    yes, unfortunately.
> >    if you have two nodes, on the same machine, with the same cookie, running the
> > same version of the distribution protocol, if should work.
>
> >    how about if you start the nodes like this;
> > erl -sname > > erl -sname >
> using "localhost" or "mail" (the name of the machine) only gave pangs.
>
> thanks for your time on this, i will chalk it up to my OpenVZ setup
> being pathalogical.
>

發佈了89 篇原創文章 · 獲贊 2 · 訪問量 18萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章