erlang远程控制其它节点

远程控制 注意setcookie设置 (看过好多文章都没有明确说明,cookie一定要一致新手很容易忽略)

1、 先启动一个langzhe节点

langzhe@lang:~/bcast_server$ erl -name [email protected] -setcookie 123456
Erlang R13B01 (erts-5.7.2) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
([email protected])1>

2、再启动lxw节点,在此节点控制langzhe 节点

langzhe@lang:~/bcast_server$ erl -name [email protected] -setcookie 123456
Erlang R13B01 (erts-5.7.2) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
([email protected])1>
User switch command
 --> h
  c [nn]            - connect to job
  i [nn]            - interrupt job
  k [nn]            - kill job
  j                 - list all jobs
  s [shell]         - start local shell
  r [node [shell]]  - start remote shell
  q        - quit erlang
  ? | h             - this message
 --> r '[email protected]'
 --> j
   1  {shell,start,[init]}
   2* {'[email protected]',shell,start,[]}
 --> c 2
*** ERROR: Shell process terminated! (^G to start new job) ***

=ERROR REPORT==== 26-Apr-2010::20:59:31 ===
Error in process <0.44.0> on node '[email protected]' with exit value: {badarg,[{erlang,list_to_existing_atom,["[email protected]"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}


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

你可能感兴趣的:(C++,c,erlang,C#,J#)