Net_kernel interconnect with nodes, disconnect, monitor

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.