测试记录:
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>