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