erlang 分布式控制

测试记录:

 

 

zdx@couchdb:~$ erl -sname 1 -setcookie 123
Erlang R13B03 (erts-5.7.4) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
(1@couchdb)1> nodes().
[]
(1@couchdb)2> net_adm:ping(2).
** exception error : no function clause matching net_adm:ping(2)
(1@couchdb)3> node().
'1@couchdb'
(1@couchdb)4> nodes().
[]
(1@couchdb)5> net_adm:ping(2@couchdb).
* 1: syntax error before: '@'
(1@couchdb)5> net_adm:ping('2@couchdb').
pong
(1@couchdb)6> nodes().
['2@couchdb']
(1@couchdb)7>
User switch command
 -->
 --> j
   1* {shell,start,[init]}
 --> j
   1* {shell,start,[init]}
 --> h

 --> s
 --> s shell
 --> s [shell]
Unknown command
 --> s shell
 --> j
   1  {shell,start,[init]}
   2  {shell,start,[]}
   3  {shell,start,[]}
   4* {shell,start,[]}
 --> j
   1  {shell,start,[init]}
   2  {shell,start,[]}
   3  {shell,start,[]}
   4* {shell,start,[]}
 --> c 2
Eshell V5.7.4  (abort with ^G)
(
 --> j
   1  {shell,start,[init]}
   2* {shell,start,[]}
   3  {shell,start,[]}
   4  {shell,start,[]}
 --> c 2

(1@couchdb)2> nodes().
['2@couchdb','3@couchdb']
(1@couchdb)3>
net_adm:ping('4@couchdb').
pong
(1@couchdb)4> nodes().
['2@couchdb','3@couchdb','4@couchdb']

(1@couchdb)5>

 

 

 

 

zdx@couchdb:~$ erl -sname 2 -setcookie 123
Erlang R13B03 (erts-5.7.4) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll                                              :false]

Eshell V5.7.4  (abort with ^G)
(2@couchdb)1> nodes().
['1@couchdb']
(2@couchdb)2>
User switch command

 --> j
   1* {shell,start,[init]}
 --> j
   1* {shell,start,[init]}
 --> c 1

(2@couchdb)2> nodes().
['1@couchdb']

(2@couchdb)3>
User switch command
 --> r '1@couchdb'
 -->  r '1@couchdb' shell
 --> j
   1  {shell,start,[init]}
   2  {'1@couchdb',shell,start,[]}
   3* {'1@couchdb',shell,start,[]}
 --> c 2
Eshell V5.7.4  (abort with ^G)
(1@couchdb)1>

 

 

zdx@couchdb:~$ erl -remsh '1@couchdb' -sname 3 -setcookie 123
Erlang R13B03 (erts-5.7.4) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll                                              :false]

Eshell V5.7.4  (abort with ^G)
(1@couchdb)1 > G
(1@couchdb)1>
User switch command
 -->

 --> j
   1* {'1@couchdb',shell,start,[]}

 -->

 

 

 

 

 

(1@couchdb)4> nodes().
['2@couchdb','3@couchdb','4@couchdb']
(1@couchdb)5>
User switch command
 --> j
   1  {shell,start,[init]}
   2* {shell,start,[]}
   3  {shell,start,[]}
   4  {shell,start,[]}

 --> r 4@couchdb
Unknown command

 --> r '4@couchdb'
 --> j
   1  {shell,start,[init]}
   2  {shell,start,[]}
   3  {shell,start,[]}
   4  {shell,start,[]}
   5* {'4@couchdb',shell,start,[]}
 --> c 5
Eshell V5.7.4  (abort with ^G)
(4@couchdb)1>

 

 

 

zdx@couchdb:~$ erl -sname 4 -setcookie 123 -detached
zdx@couchdb:~$ erl -setcookie 123
Erlang R13B03 (erts-5.7.4) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
1> nodes().
[]
2> net_adm:ping().
** exception error: undefined function net_adm:ping/0
3> net_adm:ping('1@couchdb').
pang
4> nodes().
[]
5> net_adm:ping('nonode@nohost').
pang
6>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值