求助:什么样的配置可以使emqx服务器是ipv6地址

环境信息

  • EMQ X 版本:emqx edge 4.3.11
  • 操作系统及版本:raspberrypi os(Debian 11)

问题描述

我不能够使用ipv6进行mqtt连接。
我尝试修改以下配置以及1883,8083,8084,端口的监听host,都无法启动emqx。
cluster.proto_dist = inet_tcp 修改到 cluster.proto_dist = inet6_tcp
node.name = emqx@127.0.0.1修改为node.name = emqx@::1

是否有修改为ipv6可以进行mqtt连接的教程或者例子?

配置文件及日志

erlang.log

heart: Fri Feb  4 21:37:36 2022: Erlang has closed.

heart: Fri Feb  4 21:37:36 2022: Wait 5 seconds for Erlang to terminate nicely

heart: Fri Feb  4 21:37:41 2022: Erlang still alive, kill it

heart_beat_kill_pid = 28648
Protocol 'ekka': not supported

heart: Fri Feb  4 21:37:49 2022: Erlang has closed.

heart: Fri Feb  4 21:37:49 2022: Wait 5 seconds for Erlang to terminate nicely

heart_beat_kill_pid = 29558
Protocol 'ekka': not supported

heart: Fri Feb  4 21:38:07 2022: Erlang has closed.

heart: Fri Feb  4 21:38:07 2022: Wait 5 seconds for Erlang to terminate nicely

heart_beat_kill_pid = 29625
Protocol 'ekka': not supported

heart: Fri Feb  4 21:38:09 2022: Erlang has closed.

heart: Fri Feb  4 21:38:09 2022: Wait 5 seconds for Erlang to terminate nicely


=====
===== LOGGING STARTED Fri Feb  4 21:38:11 CST 2022
=====
heart_beat_kill_pid = 30022
Protocol 'ekka': not supported

heart: Fri Feb  4 21:38:13 2022: Erlang has closed.

heart: Fri Feb  4 21:38:13 2022: Wait 5 seconds for Erlang to terminate nicely

heart: Fri Feb  4 21:38:18 2022: Erlang still alive, kill it


=====
===== LOGGING STARTED Fri Feb  4 21:38:32 CST 2022
=====

=====
===== LOGGING STARTED Fri Feb  4 21:38:34 CST 2022
=====

=====
===== LOGGING STARTED Fri Feb  4 21:38:38 CST 2022
=====

=====
===== LOGGING STARTED Fri Feb  4 21:38:44 CST 2022
=====
heart_beat_kill_pid = 301
Protocol 'ekka': not supported

heart: Fri Feb  4 21:38:53 2022: Erlang has closed.

heart: Fri Feb  4 21:38:53 2022: Wait 5 seconds for Erlang to terminate nicely

heart: Fri Feb  4 21:38:58 2022: Erlang still alive, kill it

heart_beat_kill_pid = 1436
Erlang/OTP 23 [erts-11.1.8] [emqx] [smp:1:1] [ds:1:1:1] [async-threads:1]

Starting emqx on node emqx@127.0.0.1
Start mqtt:tcp:internal listener on 0.0.0.0:11883 successfully.
Start mqtt:tcp:external listener on 0.0.0.0:1883 successfully.
Start mqtt:ws:external listener on 0.0.0.0:8083 successfully.
Start mqtt:ssl:external listener on 0.0.0.0:8883 successfully.
Start mqtt:wss:external listener on 0.0.0.0:8084 successfully.
Start http:management listener on 8081 successfully.
Start http:dashboard listener on 18083 successfully.
heart_beat_kill_pid = 1537
EMQ X Edge 4.3.11 is running now!
Protocol 'ekka': register/listen error: eaddrinuse

heart: Fri Feb  4 21:39:28 2022: Erlang has closed.

heart: Fri Feb  4 21:39:28 2022: Wait 5 seconds for Erlang to terminate nicely

Eshell V11.1.8  (abort with ^G)
(emqx@127.0.0.1)1> heart_beat_kill_pid = 1795
Protocol 'ekka': register/listen error: eaddrinuse

heart: Fri Feb  4 21:39:32 2022: Erlang has closed.

heart: Fri Feb  4 21:39:32 2022: Wait 5 seconds for Erlang to terminate nicely

heart_beat_kill_pid = 2181
Protocol 'ekka': register/listen error: eaddrinuse

heart: Fri Feb  4 21:39:34 2022: Erlang has closed.

heart: Fri Feb  4 21:39:34 2022: Wait 5 seconds for Erlang to terminate nicely


===== Fri Feb  4 21:46:29 CST 2022
Stop http:management listener on 0.0.0.0:8081 successfully.
[os_mon] memory supervisor port (memsup): Erlang has closed
[os_mon] cpu supervisor port (cpu_sup): Erlang has closed

=====
===== LOGGING STARTED Fri Feb  4 21:46:33 CST 2022
=====

=====
===== LOGGING STARTED Fri Feb  4 21:46:49 CST 2022
=====
heart_beat_kill_pid = 11054
Starting emqx on node emqx@127.0.0.1
Start mqtt:tcp:internal listener on 0.0.0.0:11883 successfully.
Start mqtt:tcp:external listener on ::1:1883 successfully.
Start mqtt:ws:external listener on 0.0.0.0:8083 successfully.
Start mqtt:ssl:external listener on 0.0.0.0:8883 successfully.
Start mqtt:wss:external listener on 0.0.0.0:8084 successfully.
Start http:management listener on 8081 successfully.
Start http:dashboard listener on 18083 successfully.
EMQ X Edge 4.3.11 is running now!
Eshell V11.1.8  (abort with ^G)
(emqx@127.0.0.1)1> heart_beat_kill_pid = 11640
Protocol 'ekka': register/listen error: eaddrinuse

heart: Fri Feb  4 21:47:11 2022: Erlang has closed.

heart: Fri Feb  4 21:47:11 2022: Wait 5 seconds for Erlang to terminate nicely

Stop http:management listener on 0.0.0.0:8081 successfully.
(emqx@127.0.0.1)1> [os_mon] memory supervisor port (memsup): Erlang has closed

[os_mon] cpu supervisor port (cpu_sup): Erlang has closed


=====
===== LOGGING STARTED Fri Feb  4 21:48:37 CST 2022
=====

=====
===== LOGGING STARTED Fri Feb  4 21:48:43 CST 2022
=====
heart_beat_kill_pid = 13537
Erlang/OTP 23 [erts-11.1.8] [emqx] [smp:1:1] [ds:1:1:1] [async-threads:1]

Starting emqx on node emqx@127.0.0.1
Start mqtt:tcp:internal listener on 0.0.0.0:11883 successfully.
Start mqtt:tcp:external listener on 0.0.0.0:1883 successfully.
Start mqtt:ws:external listener on 0.0.0.0:8083 successfully.
Start mqtt:ssl:external listener on 0.0.0.0:8883 successfully.
Start mqtt:wss:external listener on 0.0.0.0:8084 successfully.
Start http:management listener on 8081 successfully.
Start http:dashboard listener on 18083 successfully.
EMQ X Edge 4.3.11 is running now!
Eshell V11.1.8  (abort with ^G)
(emqx@127.0.0.1)1> heart_beat_kill_pid = 13794
Protocol 'ekka': register/listen error: eaddrinuse

heart: Fri Feb  4 21:49:06 2022: Erlang has closed.

heart: Fri Feb  4 21:49:06 2022: Wait 5 seconds for Erlang to terminate nicely


启动报错的信息是ekka的自动集群端口被占用了,你看下 4369 4370 5370 这几个端口有没有被别的服务占用,参考这个文档,监听 ipv6 端口的配置项参考文档
PS: 配置ipv6有的网络运营商需要开放支持才可以,你咨询一下你的网络提供商

请问一下官方有没有emqx配置ipv6地址的完整案例啊?想通过ipv6来访问服务器,小白好多不懂无从下手

管理监听器添加ipv6地址的端口比如**:::1883**
注意
不能和原ipv4的端口一样