Erlang 参考资料

时间:2023-08-24 15:59:08

Erlang 官方文档 Distributed Erlang

Erlang 教程中文版

%设定模块名
-module(tut17).
%导出相关函数
-export([start_ping/1, start_pong/0, ping/2, pong/0]).
%此处可设定编译选项。如export_all。表示忽略export中的设定,将所有函数对外暴露。此处方便调试与单元测试。
-compile(export_all).
%声明作者
-auth(allen).
%声明日期
-date('2015.08.28').
%声明版本号
-vsn('1.0.0').
%
-record
%
-define
%
-include

节选自 分布式编程http://wiki.jikexueyuan.com/project/erlang/distributed.html

启动 erl 实例

erl -name ping@42.96.194.60 -setcookie 456789
erl -name pong@43.241.222.110 -setcookie 456789

如果不手动设置相同的Cookie会导致两台服务器连接失败,出现如下拒绝访问错误:

=ERROR REPORT==== 19-Dec-2015::15:03:07 ===
** Connection attempt from disallowed node 'ping@42.96.194.60' **

可以用如下命令查看当前 erlang 实例的cookie

(pong@43.241.222.110)3> erlang:get_cookie().
'456789'

收藏比较好的 Erlang 技术Blog

Erlang Ejabberd Elixir 博客

youthy

Erlang并发编程

简书 – Erlang基础

参考

erl命令和参数

elixir-lang.org

Clustering: Connection attempt from disallowed node