Eshell V5.9 (abort with ^G) 1> net_kernel:start([test@nimbus]). {ok,<0.34.0>} (test@nimbus)2>
([email protected])3> net_kernel:longnames(). true
Eshell V5.9 (abort with ^G) 1> net_kernel:connect_node(a.zen.com). ignored 2>
[root@nimbus ligaoren]# erl -setcookie abc -name [email protected] Erlang R15B (erts-5.9) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9 (abort with ^G) ([email protected])1> net_adm:ping([email protected]). pong ([email protected])2> net_adm:ping([email protected]). pong ([email protected])3> nodes(). ['[email protected]','[email protected]'] ([email protected])4> net_kernel:disconnect([email protected]). true ([email protected])5> nodes(). ['[email protected]'] ([email protected])6> [root@nimbus ligaoren]# erl -setcookie abc -name [email protected] Erlang R15B (erts-5.9) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9 (abort with ^G) ([email protected])1> nodes(). ['[email protected]'] ([email protected])2> [root@nimbus ligaoren]# erl -setcookie abc -name [email protected] Erlang R15B (erts-5.9) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9 (abort with ^G) ([email protected])1> nodes(). ['[email protected]','[email protected]'] ([email protected])2> nodes(). ['[email protected]','[email protected]'] ([email protected])3>
Eshell V5.9 (abort with ^G) ([email protected])1> rpc:call([email protected],erlang,now,[]). {1356,605316,345986} ([email protected])2> nodes(). ['[email protected]'] ([email protected])3>
[root@nimbus ligaoren]# erl -setcookie abc -name [email protected] -kernel dist_auto_connect never Erlang R15B (erts-5.9) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9 (abort with ^G) ([email protected])1> rpc:call([email protected],erlang,now,[]). {badrpc,nodedown} ([email protected])2> net_kernel:connect_node([email protected]). true ([email protected])3> rpc:call([email protected],erlang,now,[]). {1356,605925,729498} ([email protected])4> node(). '[email protected]' ([email protected])5>
%% Node [email protected] Eshell V5.9 (abort with ^G) ([email protected])1> net_adm:ping([email protected]). pong ([email protected])2> nodes(). ['[email protected]'] ([email protected])3> %% Node [email protected] Eshell V5.9 (abort with ^G) ([email protected])1> nodes(). ['[email protected]'] ([email protected])2> =ERROR REPORT==== 27-Dec-2012::19:08:26 === global: '[email protected]' failed to connect to '[email protected]' ([email protected])2> nodes(). ['[email protected]','[email protected]'] ([email protected])3> %% Node [email protected] erl -setcookie abc -name [email protected] -kernel dist_auto_connect never Eshell V5.9 (abort with ^G) ([email protected])1> net_adm:ping([email protected]). pang ([email protected])2> net_kernel:connect_node([email protected]). true ([email protected])3> =ERROR REPORT==== 27-Dec-2012::23:06:03 === global: '[email protected]' failed to connect to '[email protected]' ([email protected])3> net_adm:ping([email protected]). pong ([email protected])4> nodes(). ['[email protected]','[email protected]'] ([email protected])5>
[root@nimbus ligaoren]# erl -setcookie abc -name [email protected] Eshell V5.9 (abort with ^G) ([email protected])1> net_kernel:monitor_nodes(true). ok ([email protected])2> net_kernel:connect_node([email protected]). true ([email protected])3> flush(). Shell got {nodeup,'[email protected]'} ok ([email protected])4> net_kernel:connect_node([email protected]). true ([email protected])5> flush(). Shell got {nodeup,'[email protected]'} ok ([email protected])6> flush(). Shell got {nodedown,'[email protected]'} ok ([email protected])7> nodes(). ['[email protected]'] ([email protected])8> flush(). ok ([email protected])9> net_kernel:connect_node([email protected]). true ([email protected])10> flush(). Shell got {nodeup,'[email protected]'} ok ([email protected])11> flush(). Shell got {nodedown,'[email protected]'} ok ([email protected])12> %%[email protected] 配合重启 erl -setcookie abc -name [email protected] Eshell V5.9 (abort with ^G) ([email protected])1> q(). ok ([email protected])2> erl -setcookie abc -name [email protected] Eshell V5.9 (abort with ^G) ([email protected])1> q(). ok ([email protected])2> %% [email protected] 节点只是打酱油的 erl -setcookie abc -name [email protected] Eshell V5.9 (abort with ^G) ([email protected])1> nodes(). ['[email protected]','[email protected]'] ([email protected])2> flush(). ok ([email protected])3>
[root@nimbus ligaoren]# erl -setcookie abc -name [email protected] Erlang R15B (erts-5.9) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9 (abort with ^G) ([email protected])1> erlang:monitor_node('[email protected]',true). true ([email protected])2> erlang:monitor_node('[email protected]',true). true ([email protected])3> ets:tab2list(sys_dist). [{connection,'[email protected]',up,<0.46.0>,undefined, {net_address,{{127,0,0,1},51575},"zen.com",tcp,inet}, [],normal}, {connection,'[email protected]',up,<0.40.0>,undefined, {net_address,{{127,0,0,1},39308},"zen.com",tcp,inet}, [],normal}] ([email protected])4> flush(). Shell got {nodedown,'[email protected]'} ok ([email protected])5> nodes(). ['[email protected]'] ([email protected])6> net_adm:ping([email protected]). pong ([email protected])7> nodes(). ['[email protected]','[email protected]'] ([email protected])8> ets:tab2list(sys_dist). [{connection,'[email protected]',up,<0.53.0>,undefined, {net_address,{{127,0,0,1},60762},"zen.com",tcp,inet}, [],normal}, {connection,'[email protected]',up,<0.46.0>,undefined, {net_address,{{127,0,0,1},51575},"zen.com",tcp,inet}, [],normal}] ([email protected])9> flush(). ok ([email protected])10> net_adm:ping([email protected]). pong ([email protected])11> ets:tab2list(sys_dist). [{connection,'[email protected]',up,<0.60.0>,undefined, {net_address,{{127,0,0,1},39809},"zen.com",tcp,inet}, [],normal}, {connection,'[email protected]',up,<0.46.0>,undefined, {net_address,{{127,0,0,1},51575},"zen.com",tcp,inet}, [],normal}] ([email protected])12> erlang:monitor_node('[email protected]',true). true ([email protected])13> ets:tab2list(sys_dist). [{connection,'[email protected]',up,<0.60.0>,undefined, {net_address,{{127,0,0,1},39809},"zen.com",tcp,inet}, [],normal}, {connection,'[email protected]',up,<0.46.0>,undefined, {net_address,{{127,0,0,1},51575},"zen.com",tcp,inet}, [],normal}] ([email protected])14> flush(). Shell got {nodedown,'[email protected]'} ok ([email protected])15>