Considerations for Erlang distributed on Linux and Windows

Source: Internet
Author: User

Nothing to do, just between two machines test Erlang distributed example, a station is WindowsXP, a set of REDHAT9, no detailed documents, their own groping for success, recorded.

1. First, the implementation of distributed Erlang provides its own security mechanism to prevent unauthorized access to the Erlang system. When an Erlang system interacts with another machine, it must have the same magic cookie, which is stored in a file called. Erlang.cookie, in order to test between two different machines, you need to edit a copy. Erlang.cookie, content, such as:
Just_test

Then copy this file to the directory where the Windows environment variable HomePath, such as my C:\Documents and Settings\admin, and the Linux copy to the environment variable $home to the directory, such as I here is/root. Special note that the Linux. erlang.cookie file needs to be set to the-R--------, which is 400, only the owner can read:
chmod. Erlang.cookie

2. Because the node name in Erlang is [email protected],host is the computer name, so you need to add the computer name and IP to the hosts file on both machines, this file is in/etc/hosts under Linux, you can edit the following with VI:

127.0.0.1 localhost localhost
x.x.x.x Zane Zane #windows机器的ip和计算机名

, hosts in the WINDOWS system's C:\WINDOWS\system32\drivers\etc directory, edit:

127.0.0.1 localhost
x.x.x.x Dennis #linux机器的名称和ip


3. The third step, to start the node, through the command erl-sname or erl-name, before this need to start the EPMD process, it is responsible for mapping the symbol name to the machine address
Performed on two machines:
Epmd-daemon

4. This configuration is complete, you can test the next Erlang distributed programming between different machines and systems (such as the ping pong example in "Introduction to Erlang (iii)-distributed programming"), very cool!

Considerations for Erlang distributed on Linux and Windows

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.