[英]Issue with connecting Erlang/Elixir VM nodes on Google Cloud Platform (GCP), same VPC - different regions, MNESIA can't replicate
I am trying to connect two Erlang VMs (running on Centos 8, Erlang/OTP 23), one located on GCP us-east1-b and other GCP europe-west6, both inside same VPC, running on separate subnets, us-east 10.33.0.0/16 eur-west on 10.88.0.0/16.我正在尝试连接两个 Erlang 虚拟机(在 Centos 8,Erlang/OTP 23 上运行),一个位于 GCP us-east1-b 和其他 GCP europe-west6 上,都在同一个 VPC 内,在不同的子网 us-east 上运行.0.0/16 eur-west 于 10.88.0.0/16。 GCP routes and firewalls should be set to allow traffic across those subnets and throughout the VPC. GCP 路由和防火墙应设置为允许跨这些子网和整个 VPC 的流量。 Ping works from VM to VM (see below). Ping 从 VM 工作到 VM(见下文)。 Telnet works to erlang epmd port 4369. ISSUE - when connecting machine to machine using erlang ping utility net_adm:ping()/1 - returns a "pang", meaning does not connect. Telnet 适用于 erlang epmd 端口 4369。问题 - 使用 erlang ping 实用程序 net_adm:ping()/1 将机器连接到机器时 - 返回“pang”,表示未连接。
Any suggestions or thoughts on what might be the issues, much appreciated !!!任何关于可能是什么问题的建议或想法,非常感谢!
Here is additional research and facts RE the setups.这是有关设置的其他研究和事实。
NOTE - the GCP firewall rules, note the GCP network "block" ing result on the test connection, and note the TELNET responses for ports 35539 and 42257 do not connect (which maybe explains why the VM's return a "pang" or can't connect)注意 - GCP 防火墙规则,注意测试连接上的 GCP 网络“阻塞”结果,并注意端口 35539 和 42257 的 TELNET 响应未连接(这可能解释了为什么虚拟机返回“pang”或不能连接)
[g@app-server1-east ~]$ erl -name ack1@10.33.0.2 -setcookie whale
Erlang/OTP 23 [erts-11.1.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [asy
nc-threads:1] [hipe]
Eshell V11.1.3 (abort with ^G)
(ack1@10.33.0.2)1> net_adm:ping('ack2@10.88.0.2').
pang
(ack1@10.33.0.2)2>
[g@app-server1-east ~]$ ping 10.88.0.2
PING 10.88.0.2 (10.88.0.2) 56(84) bytes of data.
64 bytes from 10.88.0.2: icmp_seq=1 ttl=64 time=105 ms
64 bytes from 10.88.0.2: icmp_seq=2 ttl=64 time=103 ms
64 bytes from 10.88.0.2: icmp_seq=3 ttl=64 time=104 ms
64 bytes from 10.88.0.2: icmp_seq=4 ttl=64 time=103 ms
64 bytes from 10.88.0.2: icmp_seq=5 ttl=64 time=103 ms
^C
--- 10.88.0.2 ping statistics ---
6 packets transmitted, 5 received, 16.6667% packet loss, time 12ms
rtt min/avg/max/mdev = 103.290/103.749/105.243/0.754 ms
[g@app-server1-east ~]$ epmd -names
epmd: up and running on port 4369 with data:
name ack1 at port 35539
[gbaird@app-server1-east ~]$ telnet 10.88.0.2 4369
Trying 10.88.0.2...
Connected to 10.88.0.2.
Escape character is '^]'.
exit
Connection closed by foreign host.
[g@app-server1-east ~]$ telnet 10.88.0.2 42257
Trying 10.88.0.2...
telnet: connect to address 10.88.0.2: Connection timed out here
[g@app-server2-eur ~]$ erl -name ack2@10.88.0.2 -setcookie whale
Erlang/OTP 23 [erts-11.1.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [asyn
c-threads:1] [hipe]
Eshell V11.1.3 (abort with ^G)
(ack2@10.88.0.2)1> node
(ack2@10.88.0.2)1> .
node
(ack2@10.88.0.2)2>
g@app-server2-eur ~]$ ping 10.33.0.2
PING 10.33.0.2 (10.33.0.2) 56(84) bytes of data.
64 bytes from 10.33.0.2: icmp_seq=1 ttl=64 time=105 ms
64 bytes from 10.33.0.2: icmp_seq=2 ttl=64 time=103 ms
64 bytes from 10.33.0.2: icmp_seq=3 ttl=64 time=103 ms
64 bytes from 10.33.0.2: icmp_seq=4 ttl=64 time=103 ms
^C
--- 10.33.0.2 ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 10ms
rtt min/avg/max/mdev = 103.194/103.601/104.685/0.666 ms
[g@app-server2-eur ~]$ epmd -names
epmd: up and running on port 4369 with data:
name ack2 at port 42257
[gbaird@app-server2-eur ~]$ telnet 10.33.0.2 4369
Trying 10.33.0.2...
Connected to 10.33.0.2.
Escape character is '^]'.
exit
Connection closed by foreign host.
[g@app-server2-eur ~]$ telnet 10.33.0.2 35539
Trying 10.33.0.2...
telnet: connect to address 10.33.0.2: Connection timed out
[gbaird@app-server2-eur ~]$
Erlang's EPMD (Erlang Port Mapper Daemon) is the one listening in port 4369, but the node listens in a random port. Erlang 的 EPMD(Erlang Port Mapper Daemon)是监听 4369 端口的那个,但节点监听的是随机端口。
When setting up a cluster, the node registers it's port in the local host's EPMD and contacts the remote host's EPMD to query the actual port for the remote node, then the traffic goes directly to that port.建立集群时,节点在本地主机的 EPMD 中注册它的端口,并联系远程主机的 EPMD 以查询远程节点的实际端口,然后流量直接进入该端口。 EPMD is not a relay. EPMD 不是继电器。
You can control the range of ports for the nodes to listen through kernel configuration , particularly with inet_dist_listen_min
and inet_dist_listen_max
, allowing them in the FW您可以通过kernel 配置控制节点侦听的端口范围,特别是使用inet_dist_listen_min
和inet_dist_listen_max
,允许它们在 FW
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.