Erlang Intra-Network node communication--tough four steps

Source: Internet
Author: User

Http://blog.chinaunix.net/uid-22566367-id-382011.html

In the book programming Erlang, in the tenth chapter, the main realization of the communication between the different nodes, the book listed four steps, the first step is easy to achieve, according to gourd painting scoop, it is easy to achieve the same machine, the communication between different nodes, the results of the operation and the book in full agreement.
When you are eager to try the second step (in the LAN, the communication between different machines), you may be stuck (I am so, do not know you?) ), the results of the practice are completely different from what Joe said (if you follow the book, in the Case of Kvs:start (), then RPC will get such a result--{badrpc, Nodedown}).
Below, I would like to summarize the difficult four steps,
1) Learn to use net_adm:ping ([email protected]) command.
The result may be pong, or pang. Where Pong indicates that ping is possible, Pang indicates that the ping is not available.
2) Ping the LAN.
Under the Linux shell, put your communication PC ping through.
Note that there is a possibility that the ping IP address succeeds but the ping machine name is unsuccessful because the machine name and IP address are not associated. The associated method is to edit the Hosts file inside the machine. Windows platform this file is in System32/drivers/etc, and *nix is in/etc. Connect the IP of the machine with the hostname, ping it in the operating system shell, and then go to ping under Erlang after success. (Information on the Internet)
3) Start the Erlang node.
If the above steps can be implemented, start the Erlang shell.
For example, within a local area, I started an erlang shell on different machines.
[Email protected]:~$ erl-name [email protected]-setcookie 123
[Email protected] ~]4$ erl-name [email protected]-setcookie 123
Note: If you do not use IP at startup, the following ping is not a pass.
4) Realization of net_adm:ping.
For example, I perform net_adm:ping (' [email protected] ') on the Gaoyi machine.
The result is pong, indicating that it can be ping, O (∩∩) o ... Ha ha.
Note: The parameters within the net_adm:ping () must be quoted.

So far, we have realized the communication between the local area network, can further test the program.

Erlang Intra-Network node communication--tough four steps

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.