`
langzhe
  • 浏览: 280224 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

erlang远程控制其它节点

阅读更多

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

1、 先启动一个langzhe节点

langzhe@lang:~/bcast_server$ erl -name langzhe@192.168.1.108 -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)
(langzhe@192.168.1.108)1>

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

langzhe@lang:~/bcast_server$ erl -name lxw@192.168.1.205 -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)
(lxw@192.168.1.205)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 'langzhe@192.168.1.108'
 --> j
   1  {shell,start,[init]}
   2* {'langzhe@192.168.1.108',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 'lxw@192.168.1.205' with exit value: {badarg,[{erlang,list_to_existing_atom,["langzhe@192.168.1.105"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}


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

0
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics