Q:
if my Erlang
The app is deployed on a Linux machine and can only be accessed from the command line on a Linux machine.
At this time I can run Observer:start () from the Windows machine via RPC.
And then on the Windows machine, through the interface to see the operation of the Erlang app on that Linux environment?
Answer: No problem!
1. If the Erlang VM does not specify a name when it is started, use Net_kernel to specify at run time
1> Net_kernel:start ([[email protected]]). { OK,<0.34.0>}
2. Determine if the current is longname
([email protected]) 2> net_kernel:longnames (). true
3. To get cookies and node in the Erlang program running in the Linux environment, the method is simple, enter Erlang:get_cookie () and node ().
([email protected]***) 3> node ().' [Email protected]*** '([email protected]192.168.1.***) 4> Erlang:get_cookie ().' 81**03 '
4. Modify the Erlang VM cookie to connect to the cluster only if it is the same as the process cookie to be connected
Erlang:set_cookie (node (), cookie).
net_adm:ping (Node ()).
([email protected]) 4> Erlang:set_cookie (node (), ' 81**03 '). true ([email protected])5> net_adm:ping (' [email protected]*** '). Pong
5. Start Observer:start () to see some of the information you need in the nodes option after success
([email protected]) 6> Observer:start (). OK
If there is a better way, please point out, thank you ...
Net_kernel interconnect with nodes, disconnect, monitor