Erlang communicates with virtual machine nodes under Windows

Source: Internet
Author: User
Tags get ip setcookie

When you deploy an Erlang project under Linux, many of the development processes are done in Windows and then released to Linux, so the testing process is done under the virtual machine. One day, because you want to use Erlang graphical tools such as APPMON, TV, observer, and so on in a virtual machine, it's a whim to use the Windows Erlang connection to a virtual machine to see the running state of the virtual machine.

What do I need to prepare?

I am in the VmWare10 virtual Centos6.5 system, so here are VmWare10 and Centos6.5 for example, other Linux systems and tools for reference only.

Note that the Linux Erlang must be consistent with the major version number of Erlang for Windows, such as the R15B03 Erlang that you choose under Linux, and the R16, R17 versions under Windows.

This skips the process of VMware loading software such as CentOS systems and Erlang.

First, make sure that Windows and virtual functions communicate.

In fact, this step of the VM has been done for us.

The simple test method is to ping, the command to get IP under Windows is Ipconfig,linux is Ifconfig, get the two sides ping each other.

If the ping does not work, consider reloading the VM, and we recommend that you compare the new version.

Here my Windows IP is 192.168.1.100, the IP of the virtual machine is 192.168.146.128

Start the Erlang node

Under Windows, start the Erlang node:

erl-name [email protected]-setcookie 123456

The virtual machine initiates the Erlang node:

erl-name [email protected]-setcookie 123456


Virtual Machine Update Firewall:

1. To view EPMD ports, you should see the ports occupied by the Erlang nodes and add these ports to the allowed ports on the firewall

NETSTAT-APN |grep EPMD

2, modify the Iptables

Vi/etc/sysconfig/iptables

Add 2 rows of records in the appropriate location


Command reference only, different systems or versions may differ

-A input-p tcp-m state--state new-m TCP--dport 4369-j ACCEPT

-A input-p tcp-m state--state new-m TCP--dport 30000:65535-j ACCEPT

3. Restart Iptables for policy to take effect

Service Iptables Stop

Service Iptables Start


Windows Connection Virtual Machine node:

After Windows starts the Erlang node, it connects to the remote node in the virtual machine

d:\> erl–name [Email protected]–setcookie 123456 ([email protected]) 1> net_kernel:connect (' [email protected] '). True ([email protected]) 2> nodes (). [' [Email protected] '

It means the connection is successful!


This feature is shown below with Appmon

Executes Appmon:start (). After you select the Nodes menu in the interface, there is a node option.


Reference:

http://blog.csdn.net/mycwq/article/details/24738599


Related Article

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.