第一。Erlang nodes failed to connect和Erlang - Nodes don't recognize是无用的。
我试过所有的方法。
同一台机器没问题。但它在机器之间失败了。
test@centos-1:~$ ping apple@centos-1 -c 1
PING apple@centos-1 (192.168.142.135) 56(84) bytes of data.
64 bytes from apple@centos-1 (192.168.142.135): icmp_seq=1 ttl=64 time=0.036 ms
test@centos-1:~$ ping pear@centos-2 -c 1
PING pear@centos-2 (192.168.142.136) 56(84) bytes of data.
64 bytes from pear@centos-2 (192.168.142.136): icmp_seq=1 ttl=64 time=0.292 msapple@centos-1启动
@centos-1:~$ erl -sname apple@centos_1 -kernel inet_dist_listen_min 6369 inet_dist_listen_max 7369 -setcookie CKYBWKWCWNLSPZWSLJXT
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
Eshell V12.2 (abort with ^G)
(apple@centos_1)1>梨@centos-2开始
test@centos-2:~$ erl -sname pear@centos-2 -kernel inet_dist_listen_min 6369 inet_dist_listen_max 7369 -setcookie CKYBWKWCWNLSPZWSLJXT
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
Eshell V12.2 (abort with ^G)
(pear@centos-2)1>连接失败
test@centos-1:~$ erl -sname apple@centos_1 -kernel inet_dist_listen_min 6369 inet_dist_listen_max 7369 -setcookie CKYBWKWCWNLSPZWSLJXT
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
Eshell V12.2 (abort with ^G)
(apple@centos_1)1> net
net net_adm net_kernel
(apple@centos_1)1> net_kernel:connect_node('pear@centos-2').
false
(apple@centos_1)2>我检查了我发现的所有情况
主机文件
192.168.142.135 apple@centos-1
192.168.142.136 pear@centos-2饼干
他们有同样的饼干。
防火墙
firewall-cmd --add-port=6000-8000/tcp --permanenttcpdump
没有任何包裹。
发布于 2021-12-27 17:01:19
Linux不负责服务名称,因此这个ping应该失败:
test@centos-1:~$ ping apple@centos-1 -c 1
这个linux应该成功:
test@centos-1:~$ ping centos-1 -c 1
Erlang示例经常使用称为ping/pong的函数,这些函数将使用epmd并使用@ synax。
如果域设置正确(虽然注释'-‘和'_’不一样),这看起来很好:
@centos-1:~$ erl -sname apple@centos-1 -kernel inet_dist_listen_min 6369 inet_dist_listen_max 7369 -setcookie CKYBWKWCWNLSPZWSLJXT Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
主持人只是:
192.168.142.135 centos-1
192.168.142.136 centos-2因此,您设置的pear@centos-2类行不会被erl使用。您可以使用不同的名称运行任意多个erl shell,而不需要更新主机。
一旦该设置正常工作,如果您查看/etc/rupv.conf,您应该有一个域,并且在这两台机器上都应该是相同的。如果是,您可以尝试向主机添加一个别名,如下所示:
192.168.142.135 centos-1 centos-1.example.com
192.168.142.136 centos-2 centos-2.example.com尽管理想情况下,resolv.conf中的设置是本地dns服务器,它设置了这个命名,所以centos-1.example.com和centos-2.example.com已经可以相互平分了。
https://stackoverflow.com/questions/70488097
复制相似问题