erlang的epmd

epmd有一个-stop的选项,当要是用
$epmd -stop name

的时候,本机启动的第一个erlang shell时要加上-relaxed_command_check选项,例如:
erl -sname -epmd "epmd -relaxed_command_check -daemon"

这样的话,就会实现如下效果:

[liufan@liufan ~]$ erl -sname a -epmd "epmd -relaxed_command_check -daemon"
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.2 (abort with ^G)
(a@liufan)1>

[liufan@liufan ~]$ epmd -names
epmd: up and running on port 4369 with data:
name a at port 34772
[liufan@liufan ~]$ ps -ef | grep epmd
liufan 4198 1 0 04:14 ? 00:00:00 epmd -relaxed_command_check -daemon
liufan 4318 3991 0 04:21 pts/4 00:00:00 grep epmd
[liufan@liufan ~]$ epmd -stop a
STOPPED
[liufan@liufan ~]$ epmd -names
epmd: up and running on port 4369 with data:
[liufan@liufan ~]$

而当启动的第一个erlang shell没用使用-relaxed_command_check选项时,则使用epmd -stop name则会报错,例子如下:

[liufan@liufan ~]$ erl -sname a
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.2 (abort with ^G)
(a@liufan)1>

[liufan@liufan ~]$ erl -sname b -epmd "epmd -relaxed_command_check -daemon"
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.2 (abort with ^G)
(b@liufan)1>

[liufan@liufan ~]$ epmd -names
epmd: up and running on port 4369 with data:
name b at port 41042
name a at port 33383
[liufan@liufan ~]$ ps -ef | grep epmd
liufan 4430 1 0 04:25 ? 00:00:00 /usr/local/lib/erlang/erts-5.10.2/bin/epmd -daemon
liufan 4478 3991 0 04:26 pts/4 00:00:00 grep epmd
[liufan@liufan ~]$ epmd -stop a
epmd: local epmd responded with <>
[liufan@liufan ~]$ epmd -names
epmd: up and running on port 4369 with data:
name b at port 41042
name a at port 33383
[liufan@liufan ~]$


[b]注意:[/b]当实验完第一个例子之后,要用kill杀掉epmd的进程,再实现第二个例子
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值