emqx cluster ipv6 无法跨节点订阅(5.7.2)

我现在有两个节点:
node1 配置如下:

node {
  name = "emqx@fd00:6868:6868:0:20c:29ff:fef5:b6e4"
  #name = "emqx@192.168.10.21"
  cookie = "emqxsecretcookie"
  data_dir = "/var/lib/emqx"
}

cluster {
  name = emqxcl
  discovery_strategy = static
  static {
    seeds = ["emqx@fd00:6868:6868:0:20c:29ff:fef5:b6e4", "emqx@fd00:6868:6868:0:20c:29ff:fe6d:20a0"]
  }
  proto_dist = inet6_tcp
}

listeners.tcp.default {
  bind = "[fd00:6868:6868:0:20c:29ff:fef5:b6e4]:1883"
  max_connections = 1024000
}

node2 配置如下:

node {
  name = "emqx@fd00:6868:6868:0:20c:29ff:fe6d:20a0"
  cookie = "emqxsecretcookie"
  data_dir = "/var/lib/emqx"
}

cluster {
  name = emqxcl
  proto_dist = inet6_tcp
  discovery_strategy = static
  static {
    seeds = ["emqx@fd00:6868:6868:0:20c:29ff:fef5:b6e4", "emqx@fd00:6868:6868:0:20c:29ff:fe6d:20a0"]
  }
}

listeners.tcp.default {
  bind = "[fd00:6868:6868:0:20c:29ff:fe6d:20a0]:1883"
  max_connections = 1024000
}

启动以后,emqx_ctl cluster status 显示集群状态正常:

Cluster status: #{running_nodes =>
                      ['emqx@fd00:6868:6868:0:20c:29ff:fe6d:20a0',
                       'emqx@fd00:6868:6868:0:20c:29ff:fef5:b6e4'],
                  stopped_nodes => []}

web 页面集群状态也显示正常。
现在的问题是:我在 node1 订阅,
mosquitto_sub -h fd00:6868:6868:0:20c:29ff:fe6d:20a0 -p 1883 -t test_topic
无法收到在 node2 发布的消息
mosquitto_pub -h fd00:6868:6868:0:20c:29ff:fef5:b6e4 -p 1883 -t test_topic -m “Hello, EMQX!”
但是在 ipv4 下就一切正常,烦请帮忙解答,谢谢

麻烦上传一个 emqx 的 debug 日志。日志 | EMQX文档

node1.tar.gz (8.5 KB)
node2.tar.gz (13.4 KB)

[error] event=connect_to_remote_server, peer=emqx@fd00:6868:6868:0:20c:29ff:fe6d:20a0, port=5370, reason=nxdomain
2025-03-13T03:16:21.278874+00:00 [error] crasher: initial call: gen_rpc_client:init/1, pid: <0.3529.0>, registered_name: , exit: {{badrpc,nxdomain},[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,961}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,241}]}]},
这个nxdomain non-existent domain 是连不上这个IP:Port

  • DNS resolution issues for the IPv6 address
  • Network configuration problems
  • Firewall blocking the connection
  • The remote node might be down or unreachable
    你得查查你的 DNS 配置,用 telnet 试试能不能通。

之前 rpc 是监听的 ipv4,我新增了配置 rpc { listen_address = “::” } 以后,5370 监听 ipv6了,但是还是有那个日志:2025-03-13T05:22:29.413134+00:00 [error] event=connect_to_remote_server, peer=emqx@fd00:6868:6868:0:20c:29ff:fe6d:20a0, port=5370, reason=nxdomain

另外 telnet 是正常的:
root@vir21:/var/log/emqx# telnet fd00:6868:6868:0:20c:29ff:fe6d:20a0 5370
Trying fd00:6868:6868:0:20c:29ff:fe6d:20a0…
Connected to fd00:6868:6868:0:20c:29ff:fe6d:20a0.
Escape character is ‘^]’.

问题解决了,在 rpc 块加了个参数就行了 ipv6_only = true,非常感谢