2008 December 18th Thursday

本文介绍了Erlang分布式系统的架构原理,详细解释了节点之间的通信机制,包括进程间消息传递、连接建立与断开的过程。同时探讨了长节点名与短节点名的区别及其对通信的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

   A distributed Erlang system consists of a number of Erlang runtime systems communicating with each other. Each such runtime system
is called a node. Message passing between processes at different nodes, as well as links and monitors, are transparent when pids are used.
Registered names, however, are local to each node. This means the node must be specified as well when sending messages etc. using registered
names.

Nodes

  A node is an executing Erlang runtime system which has been given a name, using the command line flag -name (long names) or -sname (short names).

  The format of the node name is an atom name@host where name is the name given by the user and host is the full host name if long names
are used, or the first part of the host name if short names are used. node() returns the name of the node.

  Note: A node with a long node name cannot communicate with a node with a short node name.

  The nodes in a distributed Erlang system are loosely connected. The first time the name of another node is used, for example if spawn(Node,M,F,A)
or net_adm:ping(Node) is called, a connection attempt to that node will be made.

  Connections are by default transitive. If a node A connects to node B, and node B has a connection to node C, then node A will also try to connect
to node C. This feature can be turned off by using the command line flag -connect_all false, see erl(1).

  If a node goes down, all connections to that node are removed. Calling erlang:disconnect(Node) will force disconnection of a node.

  The list of (visible) nodes currently connected to is returned by nodes().
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值